- 状态
- 已解决
- 报告针对
- WPML Multilingual CMS 4.6.9
- 解决于
- WPML Multilingual CMS 4.6.13
- 相关插件/主题
- Google XML Sitemaps
- 主题标签
- Bug
问题概述
在某些情况下,您可能会遇到类似以下的 PHP 警告,特别是在将 Google XML Sitemaps 插件与我们的系统一起使用时:
Warning: preg_match(): Unknown modifier '-' in /wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php on line 186
临时解决方法
在继续操作之前,请确保对您的站点进行完整备份。
- 打开 …/wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php 文件。
- 找到第 186 行。
- 将:
if ( preg_match( "!^$match!", $request_match, $matches ) || preg_match( "!^$match!", urldecode( $request_match ), $matches ) ) { - 替换为:
if ( preg_match( "~^$match~", $request_match, $matches ) || preg_match( "~^$match~", urldecode( $request_match ), $matches ) ) {