Check links for using an accepted scheme during validation (http, https,

ftp)
This commit is contained in:
jrenslin committed 2022-03-30 13:03:04 +02:00
1 parent 7c02bbb8ad
commit 65aaea4097
1 file changed
+5
+5
View File
@@ -202,6 +202,11 @@ public static function sanitize_url(mixed $input):string {
throw new MDInvalidUrl("Invalid input URL");
}
// Check for valid schemes
if (MD_STD::startsWithAny($input, ['https://', 'http://', 'ftp://']) === false) {
throw new MDInvalidUrl("Invalid input URL");
}
return $output;
}