今天在测试站点发现一个问题,网站头满屏的:
Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /www/wwwroot/www.machunjie.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /www/wwwroot/www.machunjie.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /www/wwwroot/www.machunjie.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
有点奇怪,主站就没事,找到文件查看:
// Override function clean_id($id) { $id = CrayonUtil::space_to_hyphen( strtolower(trim($id)) ); return preg_replace('/[^\w-+#]/msi', '', $id); }
找到报错的这一行,将return preg_replace('/[^\w-+#]/msi', '', $id);
改为return preg_replace('/\[^\w-+#]/msi', '', $id);
本文最后更新于2019年6月26日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!