Explorar o código

用户名特殊字符

theo %!s(int64=3) %!d(string=hai) anos
pai
achega
81cf5a97a7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      common/helpers/Validator.php

+ 1 - 1
common/helpers/Validator.php

@@ -33,7 +33,7 @@ class Validator extends \yii\validators\Validator {
         'fullPrice'         =>  ["/^\-?[0-9]+([.]{1}[0-9]{1,2})?$/", ' must be in the amount format'], // 必须为金额格式
         'simpleIdCard'  =>  ["/^\d{6}(19|2\d)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)?$/", '必须为身份证号码格式'],
         'userName'  =>  ["|^[a-z0-9]+$|", '只允许小写英文数字'],
-        'realName'  =>  ["/^([\x{4E00}-\x{FA29}]|[\x{E7C7}-\x{E7F3}]|[a-zA-Z0-9])*$/u", '不允许包含特殊字符'],
+        'realName'  =>  ["/^([\x{4E00}-\x{FA29}]|[\x{E7C7}-\x{E7F3}]|[a-zA-Z0-9. ])*$/u", '不允许包含特殊字符'],
         'idCard'        => 'idCardValidate',
         'yearMonth'       =>  ["/^\d{4}([0][0-9]|[1][0-2]|[0-9])$/", '必须为年月格式'],
     ];