mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding check for domain name length in Validation::url(), thanks AD7six
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7033 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
fdc26e38aa
commit
082aedc0b3
1 changed files with 1 additions and 1 deletions
|
@ -791,7 +791,7 @@ class Validation extends Object {
|
||||||
$_this =& Validation::getInstance();
|
$_this =& Validation::getInstance();
|
||||||
$_this->check = $check;
|
$_this->check = $check;
|
||||||
$_this->regex = '/^(?:(?:https?|ftps?|file|news|gopher):\\/\\/)?(?:(?:(?:25[0-5]|2[0-4]\d|(?:(?:1\d)?|[1-9]?)\d)\.){3}(?:25[0-5]|2[0-4]\d|(?:(?:1\d)?|[1-9]?)\d)'
|
$_this->regex = '/^(?:(?:https?|ftps?|file|news|gopher):\\/\\/)?(?:(?:(?:25[0-5]|2[0-4]\d|(?:(?:1\d)?|[1-9]?)\d)\.){3}(?:25[0-5]|2[0-4]\d|(?:(?:1\d)?|[1-9]?)\d)'
|
||||||
. '|(?:[0-9a-z]{1}[0-9a-z\\-]*\\.)*(?:[0-9a-z]{1}[0-9a-z\\-]{0,56})\\.(?:[a-z]{2,6}|[a-z]{2}\\.[a-z]{2,6})'
|
. '|(?:[0-9a-z]{1}[0-9a-z\\-]*\\.)*(?:[0-9a-z]{1}[0-9a-z\\-]{0,62})\\.(?:[a-z]{2,6}|[a-z]{2}\\.[a-z]{2,6})'
|
||||||
. '(?::[0-9]{1,4})?)(?:\\/?|\\/[\\w\\-\\.,\'@?^=%&:;\/~\\+#]*[\\w\\-\\@?^=%&\/~\\+#])$/i';
|
. '(?::[0-9]{1,4})?)(?:\\/?|\\/[\\w\\-\\.,\'@?^=%&:;\/~\\+#]*[\\w\\-\\@?^=%&\/~\\+#])$/i';
|
||||||
return $_this->_check();
|
return $_this->_check();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue