mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
sanitized url in url Validation
This commit is contained in:
parent
c634d12ef4
commit
f6c586986d
1 changed files with 7 additions and 1 deletions
|
|
@ -49,7 +49,13 @@ class URL extends Validator
|
|||
*/
|
||||
public function isValid($value): bool
|
||||
{
|
||||
if (\filter_var($value, FILTER_VALIDATE_URL) === false) {
|
||||
$sanitized_url = '';
|
||||
|
||||
foreach (str_split($value) as $character) {
|
||||
$sanitized_url .= (ord($character) > 127) ? rawurlencode($character) : $character;
|
||||
}
|
||||
|
||||
if (\filter_var($sanitized_url, FILTER_VALIDATE_URL) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue