Add tests to ensure invalid IDs are not validated
This commit is contained in:
2 files changed
+18
-8
No files matched your search
@@ -375,7 +375,6 @@ private static function validateGndId(string $id, array $prefixes):string|false
|
||||
return false;
|
||||
}
|
||||
if (self::_is_numeric(strtr($id, ['-' => '', 'X' => ''])) === false) {
|
||||
throw new Exception($id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -611,9 +610,9 @@ public function validateId(string $id):string|false {
|
||||
'https://vocab.getty.edu/page/aat/',
|
||||
]),
|
||||
self::ackerbau => self::validateNumericId($id, ['https://term.museum-digital.de/ackerbau/tag/']),
|
||||
self::bne => self::validateBneId($id, ['http://datos.bne.es/persona/']),
|
||||
self::bne => self::validateBneId($id, ['http://datos.bne.es/persona/', 'https://datos.bne.es/persona/']),
|
||||
self::bnf => self::validateBnfId($id),
|
||||
self::cona => self::validateNumericId($id, ['https://vocab.getty.edu/page/cona/']),
|
||||
self::cona => self::validateNumericId($id, ['http://vocab.getty.edu/page/cona/', 'https://vocab.getty.edu/page/cona/']),
|
||||
self::editionhumboldtdigital => self::validateGndId($id, ['https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/']),
|
||||
self::gnd => self::validateGndId($id, ['http://d-nb.info/gnd/', 'https://d-nb.info/gnd/']),
|
||||
self::grobsystematik => self::validateNumericId($id, ['https://term.museum-digital.de/grobsystematik/tag/']),
|
||||
|
||||
Reference in new issue
Block a user