stanley-king vor 11 Monaten
Ursprung
Commit
bad111c40e
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 2 2
      helper/mtopcard/mtopcard.php
  2. 1 1
      test/TestCardNo.php

+ 2 - 2
helper/mtopcard/mtopcard.php

@@ -262,7 +262,7 @@ function simple_card_type($cardno)
         return SinopecCard;
     } elseif (preg_match('/^[79][0-9]{15}$/', $cardno, $matches)) {
         return PetroChinaCard;
-    } elseif (preg_match('/^134[0-8]\d{7}$|^(?:13[5-9]|15[012789]|17[28]|18[23478]|19[578])\d{8}$/', $cardno, $matches)) {
+    } elseif (preg_match('/^134[0-8]\d{7}$|^(?:13[5-9]|14[7]|15[012789]|17[28]|18[23478]|19[578])\d{8}$/', $cardno, $matches)) {
         return ChinaMobileCard;
     } elseif (preg_match('/^(?:13[0-2]|15[56]|166|17[156]|18[56]|196)\d{8}$/', $cardno, $matches)) {
         return ChinaUnicomCard;
@@ -289,7 +289,7 @@ function card_type($cardno,&$regin_no)
     elseif(preg_match('/^1\d{10}$/',$cardno,$matches))
     {
         $regin_no = -1;
-        if (preg_match('/^134[0-8]\d{7}$|^(?:13[5-9]|15[012789]|17[28]|18[23478]|19[578])\d{8}$/', $cardno, $matches)) {
+        if (preg_match('/^134[0-8]\d{7}$|^(?:13[5-9]|14[7]|15[012789]|17[28]|18[23478]|19[578])\d{8}$/', $cardno, $matches)) {
             return ChinaMobileCard;
         }
         elseif (preg_match('/^(?:13[0-2]|15[56]|166|17[156]|18[56]|196)\d{8}$/', $cardno, $matches)) {

+ 1 - 1
test/TestCardNo.php

@@ -98,7 +98,7 @@ class TestCardNo extends TestCase
 
     public function testCardType()
     {
-        $card_no = 15970039005;
+        $card_no = 14761582181;
         $card_type = mtopcard\card_type($card_no,$region);
 
     }