Improve handling of broken GND references

This commit is contained in:
jrenslin committed 2026-07-10 01:07:05 +02:00
1 parent be6a6c412e
commit ab58d0c042
1 file changed
+5 -1
+5 -1
View File
@@ -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, ' ')) {
$id = strtr($id, [' ' => '', "\t" => '']);
}
if (str_contains($id, ',')) {
$idParts = explode(',', $id);
$id = $idParts[0];
}
if (filter_var($id, FILTER_VALIDATE_URL) !== false) {
$toRemove = [];