mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-12 20:49:50 +00:00
"Fixes #3606, Validation::phone method regex allows any string containing phone number"
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6085 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
586ff7201c
commit
bb9148a302
1 changed files with 1 additions and 1 deletions
|
@ -609,7 +609,7 @@ class Validation extends Object {
|
|||
if (is_null($this->regex)) {
|
||||
switch ($this->country) {
|
||||
case 'us':
|
||||
$this->regex = '/1?[-. ]?\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})/';
|
||||
$this->regex = '/^1?[-. ]?\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue