优化手机号正则

main
gzydong 2021-07-01 19:11:11 +08:00
parent 4590728cb1
commit dc6bf006d8
2 changed files with 2 additions and 2 deletions

View File

@ -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']) {

View File

@ -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);
});
}
}