优化手机号正则
parent
4590728cb1
commit
dc6bf006d8
|
@ -103,7 +103,7 @@ class UploadController extends CController
|
|||
$user_id = $this->uid();
|
||||
$uploadRes = $this->splitUploadService->upload($user_id, $file, $params['hash'], intval($params['split_index']), intval($params['size']));
|
||||
if (!$uploadRes) {
|
||||
return $this->response->fail('上传文件失败111!');
|
||||
return $this->response->fail('上传文件失败!');
|
||||
}
|
||||
|
||||
if (($params['split_index'] + 1) == $params['split_num']) {
|
||||
|
|
|
@ -40,7 +40,7 @@ class ValidatorFactoryResolvedListener implements ListenerInterface
|
|||
$validatorFactory->extend('phone', function ($attribute, $value) {
|
||||
if (!is_string($value)) return false;
|
||||
|
||||
return (bool)preg_match('/^1[345789][0-9]{9}$/', $value);
|
||||
return (bool)preg_match('/^1[3456789][0-9]{9}$/', $value);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue