Fix #1856 missing IDN support in URL validator

This commit is contained in:
Kijin Sung 2022-01-27 21:37:19 +09:00
parent d20fd9ca47
commit 8310f82a1a
2 changed files with 12 additions and 15 deletions

View file

@ -88,7 +88,7 @@ class Validator
$this->addRule(array(
'email' => '/^[\w-]+((?:\.|\+|\~)[\w-]+)*@[\w-]+(\.[\w-]+)+$/',
'userid' => '/^[a-z]+[\w-]*[a-z0-9_]+$/i',
'url' => '/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-]+)+(:\d+)?/',
'url' => '/^https?:\/\/[^\\\\/]+!',
'alpha' => '/^[a-z]*$/i',
'alpha_number' => '/^[a-z][a-z0-9_]*$/i',
'number' => '/^(?:[1-9]\\d*|0)$/',