本帖最后由 jiangchuankyo 于 2018-8-17 15:28 编辑
source/function/function_core.php,网上流传的那个修复代码有问题, 模仿官方3.4写的, 但preg_replace_callback不像preg_replace那样支持数组, 不支持/e, 不支持\\1,所以须改成下面的代码: // preg_replace_callback不支持数组换为foreach, 去掉了末尾的/e, \\1替换成传入的匹配数组$matches[1]
搜索:
- $content = preg_replace($_G['setting']['output']['preg']['search'], $_G['setting']['output']['preg']['replace'], $content);
复制代码
替换为:
foreach($_G['setting']['output']['preg']['search'] as $key => $value) {
$content = preg_replace_callback(preg_replace('#e$#', '', $value), create_function('$matches', 'return '.preg_replace("#'\\\+([0-9]+)'#", '$matches[${1}]', $_G['setting']['output']['preg']['replace'][$key].';')), $content);
}
|