Skip to content

Commit

Permalink
Merge pull request #96 from hemmat/master
Browse files Browse the repository at this point in the history
Added the new mobile operator (Rightel) prefix to the mobile validation ...
  • Loading branch information
Mark S. committed Apr 4, 2015
2 parents aede3a2 + af1bfd2 commit f1b6e3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Test/Case/Validation/IrValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public function testMobile() {
$this->assertTrue(IrValidation::mobile('+98 9373334444'));
$this->assertTrue(IrValidation::mobile('(+98) 9383334444'));
$this->assertTrue(IrValidation::mobile('+98-9323334444'));
$this->assertTrue(IrValidation::mobile('+989203334444'));

$this->assertFalse(IrValidation::mobile('teststring'));
$this->assertFalse(IrValidation::mobile('999123334444'));
Expand Down
2 changes: 1 addition & 1 deletion Validation/IrValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function phone($check) {
* @return bool Success.
*/
public static function mobile($check) {
$pattern = '/^[- .\(\)]?((98)|(\+98)|(0098)|0){1}[- .\(\)]{0,3}((91)|(93)){1}[0-9]{8}$/';
$pattern = '/^[- .\(\)]?((98)|(\+98)|(0098)|0){1}[- .\(\)]{0,3}((91)|(92)|(93)){1}[0-9]{8}$/';
return (bool)preg_match($pattern, $check);
}

Expand Down

0 comments on commit f1b6e3f

Please sign in to comment.