【发布时间】:2015-07-31 09:55:18
【问题描述】:
错误是:
PHP 警告:preg_match(): Compilation failed: missing ) 在 /home/siteraja/public_html/ar/wp-content/plugins/hide_my_wp/lib/mute-screamer/libraries/IDS/Monitor.php 中的偏移量 16第 312 行 这是第 227 行的代码:
// check if this field is part of the exceptions
if (is_array($this->exceptions)) {
foreach($this->exceptions as $exception) {
$matches = array();
$reg = '/'.str_replace('%','[A-Za-z0-9_-]*', str_replace('.','\.',$exception)).'/i';
if (preg_match($reg, $key))
return false;
}
}
【问题讨论】:
-
发布您的原始字符串以及预期输出
-
试试
$reg = '/'.str_replace('%','[A-Za-z0-9_-]*', preg_quote($exception)).'/i'; -
他的意思是发布
$this->exception或$this->exceptions的内容,以便我们可以看到传递到$reg计算中的内容 -
您的异常字符串不会包含
'或/字符吗? -
我的回答有帮助吗?