@@ -438,6 +438,11 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
|
|||||||
$id = strtr($id, $toRemove);
|
$id = strtr($id, $toRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle extended IDs (like "4114170-2 (Fenster (Motiv)")
|
||||||
|
if (str_contains($id, '(')) {
|
||||||
|
$id = trim(explode('(', $id)[0]);
|
||||||
|
}
|
||||||
|
|
||||||
// There is an issue with this regex
|
// There is an issue with this regex
|
||||||
if (preg_match("/^[0-9-X]*$/", $id) === false) {
|
if (preg_match("/^[0-9-X]*$/", $id) === false) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ final class MDNodaRepositoryTest extends TestCase {
|
|||||||
self::assertEquals("1037602218", MDNodaRepository::gnd->validateId("https://explore.gnd.network/gnd/1037602218"));
|
self::assertEquals("1037602218", MDNodaRepository::gnd->validateId("https://explore.gnd.network/gnd/1037602218"));
|
||||||
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("102423008"));
|
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("102423008"));
|
||||||
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("102423008,"));
|
self::assertEquals("102423008", MDNodaRepository::gnd->validateId("102423008,"));
|
||||||
|
self::assertEquals("4114170-2", MDNodaRepository::gnd->validateId("4114170-2"));
|
||||||
|
self::assertEquals("4114170-2", MDNodaRepository::gnd->validateId("4114170-2 (Fenster (Motiv)"));
|
||||||
self::assertEquals(false, MDNodaRepository::gnd->validateId("fkld;s102423008"));
|
self::assertEquals(false, MDNodaRepository::gnd->validateId("fkld;s102423008"));
|
||||||
|
|
||||||
// NDL (Japan)
|
// NDL (Japan)
|
||||||
|
|||||||
Reference in New Issue
Block a user