WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.6.9
Resolved in
WPML Multilingual CMS 4.6.13
Related plugin/theme
Google XML Sitemaps
Topic tags
Bug

Overview of the issue

Under some scenarios, you may encounter a PHP warning like the following, particularly if you are using Google XML Sitemaps plugin alongside our system


Warning: preg_match(): Unknown modifier '-' in /wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php on line 186

Workaround

Please, make sure of having a full backup of your site before proceeding.


  • Open …/wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php file.

  • Look for line 186.

  • Replace:
    if ( preg_match( "!^$match!", $request_match, $matches ) || preg_match( "!^$match!", urldecode( $request_match ), $matches ) ) {

  • With:
    if ( preg_match( "~^$match~", $request_match, $matches ) || preg_match( "~^$match~", urldecode( $request_match ), $matches ) ) {

All known issues →