Remove trailing slashes from vocabulary links delivered as URLs
This commit is contained in:
parent
dcfba67422
commit
7912066f71
@ -330,7 +330,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
||||
foreach ($prefixes as $prefix) {
|
||||
$toRemove[$prefix] = "";
|
||||
}
|
||||
$id = strtr($id, $toRemove);
|
||||
$id = trim(strtr($id, $toRemove), '/');
|
||||
}
|
||||
|
||||
if (!self::_is_numeric($id)) {
|
||||
|
@ -65,6 +65,7 @@ final class MDNodaRepositoryTest extends TestCase {
|
||||
|
||||
self::assertEquals("248941990", MDNodaRepository::viaf->validateId("https://viaf.org/viaf/248941990"));
|
||||
self::assertEquals("248941990", MDNodaRepository::viaf->validateId("http://viaf.org/viaf/248941990"));
|
||||
self::assertEquals("42893419", MDNodaRepository::viaf->validateId("https://viaf.org/viaf/42893419/"));
|
||||
self::assertEquals("86145857811423020454", MDNodaRepository::viaf->validateId("86145857811423020454"));
|
||||
self::assertEquals("2869150688328112660005", MDNodaRepository::viaf->validateId("2869150688328112660005"));
|
||||
self::assertEquals(false, MDNodaRepository::viaf->validateId("2869150688328112;;660005"));
|
||||
|
Loading…
Reference in New Issue
Block a user