Handle extended GND IDs (like 4114170-2 Fenster (Motiv))

Close #46
This commit is contained in:
jrenslin committed 2025-12-03 14:54:03 +01:00
1 parent 59aba25d0e
commit 3d8dac9910
2 files changed
+7

No files matched your search

+5
View File
@@ -438,6 +438,11 @@ private static function validateGndId(string $id, array $prefixes):string|false
$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
if (preg_match("/^[0-9-X]*$/", $id) === false) {
return false;