"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:
phpnut 2007-11-26 17:52:51 +00:00
parent 586ff7201c
commit bb9148a302

View file

@ -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;
}
}