From 5f57d7187a77086a9d6fb3a35f5f1ddc91203dcc Mon Sep 17 00:00:00 2001 From: arash hemmat Date: Sat, 4 Apr 2015 14:31:30 +0430 Subject: [PATCH 1/2] Added the new mobile operator (Rightel) prefix to the mobile validation rule. --- Validation/IrValidation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/IrValidation.php b/Validation/IrValidation.php index 7eb70c0a..df076a71 100644 --- a/Validation/IrValidation.php +++ b/Validation/IrValidation.php @@ -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); } From af1bfd235d9ca116f82df79685678cc0d9ac5c4e Mon Sep 17 00:00:00 2001 From: arash hemmat Date: Sat, 4 Apr 2015 20:02:19 +0430 Subject: [PATCH 2/2] Added the new mobile operator (Rightel) prefix to the mobile validation rule. --- Test/Case/Validation/IrValidationTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Test/Case/Validation/IrValidationTest.php b/Test/Case/Validation/IrValidationTest.php index d82dcbe5..9ccd4618 100644 --- a/Test/Case/Validation/IrValidationTest.php +++ b/Test/Case/Validation/IrValidationTest.php @@ -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'));