Skip to content

Commit

Permalink
修复: Regexp 语法错误
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxian committed Sep 5, 2019
1 parent db6edad commit 1188e10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Misc/Regexp.php
Expand Up @@ -47,9 +47,9 @@ public static function check($regExp, $string)
$regExpValue = array_key_exists($regExp, $regExpType) ? $regExpType[$regExp] : $regExp;

if (substr($regExpValue, 0, 1) != '/') {
throw new ephpException('<font color="red">在默认库中 ' . $regExp . ' 的规则匹配失败,系统使用你的输入作为正则规则,但你输入的正则语法错误。</font> 合法的规则如: /^[0-9]+$/ 请检查后重试!', 1554);
\throw_error('<font color="red">在默认库中 ' . $regExp . ' 的规则匹配失败,系统使用你的输入作为正则规则,但你输入的正则语法错误。</font> 合法的规则如: /^[0-9]+$/ 请检查后重试!', 1554);
}
//dump($regExpValue);

return preg_match($regExpValue, $string);
}
}

0 comments on commit 1188e10

Please sign in to comment.