Improve handling of broken GND references
This commit is contained in:
1 file changed
+5
-1
@@ -143,7 +143,7 @@ public static function fromUrl(string $input):MDNodaRepository {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new MDInvalidNodaLink("Failed to get norm data repository based on the provided link");
|
throw new MDInvalidNodaLink("Failed to get norm data repository based on the provided link: " . $input);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,6 +478,10 @@ private static function validateGndId(string $id, array $prefixes):string|false
|
|||||||
if (str_contains($id, ' ')) {
|
if (str_contains($id, ' ')) {
|
||||||
$id = strtr($id, [' ' => '', "\t" => '']);
|
$id = strtr($id, [' ' => '', "\t" => '']);
|
||||||
}
|
}
|
||||||
|
if (str_contains($id, ',')) {
|
||||||
|
$idParts = explode(',', $id);
|
||||||
|
$id = $idParts[0];
|
||||||
|
}
|
||||||
|
|
||||||
if (filter_var($id, FILTER_VALIDATE_URL) !== false) {
|
if (filter_var($id, FILTER_VALIDATE_URL) !== false) {
|
||||||
$toRemove = [];
|
$toRemove = [];
|
||||||
|
|||||||
Reference in new issue
Block a user