diff --git a/src/enums/MDNodaRepository.php b/src/enums/MDNodaRepository.php index 1199cb4..b9bb102 100644 --- a/src/enums/MDNodaRepository.php +++ b/src/enums/MDNodaRepository.php @@ -799,7 +799,7 @@ public static function validateBnfId(string $id):string|false { */ public function validateId(string $id):string|false { - $id = rtrim($id, " ,\t~-"); + $id = rtrim($id, " ,\t~-      "); return match($this) { self::allgemein => filter_var($id, FILTER_VALIDATE_URL), diff --git a/tests/MDNodaRepositoryTest.php b/tests/MDNodaRepositoryTest.php index b9d517e..5f5dd37 100644 --- a/tests/MDNodaRepositoryTest.php +++ b/tests/MDNodaRepositoryTest.php @@ -126,8 +126,10 @@ public static function bnfIdForValidationProvider():Generator { public static function gndIdForValidationProvider():Generator { yield "Full URL, http / 102423008" => ["102423008", "http://d-nb.info/gnd/102423008"]; + yield "Full URL, http / 118572636" => ["118572636", "http://d-nb.info/gnd/118572636     "]; yield "Full URL, https / 102423008" => ["102423008", "https://d-nb.info/gnd/102423008"]; yield "Full URL, http, superfluous spaces / 102423008" => ["102423008", "http://d-nb.info/gnd/ 102423008"]; + yield "Full URL, http, superfluous spaces at the end / 102423008" => ["102423008", "http://d-nb.info/gnd/102423008 "]; yield "Full URL, http / 1037602218" => ["1037602218", "http://d-nb.info/gnd/1037602218"]; yield "Full URL, GND Explorer / 1037602218" => ["1037602218", "https://explore.gnd.network/gnd/1037602218"];