Check links for using an accepted scheme during validation (http, https,
ftp)
This commit is contained in:
1 file changed
+5
@@ -202,6 +202,11 @@ public static function sanitize_url(mixed $input):string {
|
|||||||
throw new MDInvalidUrl("Invalid input URL");
|
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;
|
return $output;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user