Skip to content

Commit

Permalink
make validator only pass if the number is valid for one of the specif…
Browse files Browse the repository at this point in the history
…ied countries
  • Loading branch information
Joseph Paul committed May 4, 2015
1 parent 19ad884 commit 86d55cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Propaganistas/LaravelPhone/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function phone($attribute, $value, $parameters, $validator)
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
try {
$phoneProto = $phoneUtil->parse($value, $country);
if ($phoneUtil->isValidNumber($phoneProto)) {
if ($phoneUtil->isValidNumberForRegion($phoneProto, $country)) {
return TRUE;
}
}
Expand Down

0 comments on commit 86d55cc

Please sign in to comment.