Extend trimming in MDNodaRepository to cover weird whitespaces
This commit is contained in:
2 files changed
+3
-1
No files matched your search
@@ -799,7 +799,7 @@ public static function validateBnfId(string $id):string|false {
|
|||||||
*/
|
*/
|
||||||
public function validateId(string $id):string|false {
|
public function validateId(string $id):string|false {
|
||||||
|
|
||||||
$id = rtrim($id, " ,\t~-");
|
$id = rtrim($id, " ,\t~- ");
|
||||||
|
|
||||||
return match($this) {
|
return match($this) {
|
||||||
self::allgemein => filter_var($id, FILTER_VALIDATE_URL),
|
self::allgemein => filter_var($id, FILTER_VALIDATE_URL),
|
||||||
|
|||||||
@@ -126,8 +126,10 @@ public static function bnfIdForValidationProvider():Generator {
|
|||||||
public static function gndIdForValidationProvider():Generator {
|
public static function gndIdForValidationProvider():Generator {
|
||||||
|
|
||||||
yield "Full URL, http / 102423008" => ["102423008", "http://d-nb.info/gnd/102423008"];
|
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, 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 / 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, http / 1037602218" => ["1037602218", "http://d-nb.info/gnd/1037602218"];
|
||||||
yield "Full URL, GND Explorer / 1037602218" => ["1037602218", "https://explore.gnd.network/gnd/1037602218"];
|
yield "Full URL, GND Explorer / 1037602218" => ["1037602218", "https://explore.gnd.network/gnd/1037602218"];
|
||||||
|
|||||||
Reference in new issue
Block a user