diff --git a/src/Common.php b/src/Common.php index b3ba111..f84ad98 100644 --- a/src/Common.php +++ b/src/Common.php @@ -820,7 +820,7 @@ public function emailValidator(string $string): bool #Function to check if string is an URI as per RFC 3986 public function uriValidator(string $string): bool { - if (preg_match('/^(?[a-z][a-z0-9+.-]+):(?\/\/(?[^@]+@)?(?[a-z0-9.\-_~]+)(?:\d+)?)?(?(?:[a-z0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@])+(?:\/(?:[a-z0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@])*)*|(?:\/(?:[a-z0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@])+)*)?(?\?(?:[a-z0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@]|[\/?])+)?(?\#(?:[a-z0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@]|[\/?])+)?$/i', $this->htmlToRFC3986($string)) === 1) { + if (preg_match('/^(?[a-z][a-z0-9+.-]+):(?\/\/(?[^@]+@)?(?[\p{L}0-9.\-_~]+)(?:\d+)?)?(?(?:[\p{L}0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@])+(?:\/(?:[\p{L}0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@])*)*|(?:\/(?:[\p{L}0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@])+)*)?(?\?(?:[\p{L}0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@]|[\/?])+)?(?\#(?:[\p{L}0-9-._~]|%[a-f0-9]|[!$&\'()*+,;=:@]|[\/?])+)?$/iu', $this->htmlToRFC3986($string)) === 1) { return true; } else { return false;