Improve handling of broken GND references

This commit is contained in:
2026-07-10 01:07:05 +02:00
parent be6a6c412e
commit ab58d0c042
+5 -1
View File
@@ -143,7 +143,7 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
} }
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 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
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 = [];