Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Bruno Kos 1 year, 2 months ago.

Assisted by: Bruno Kos.

Author Posts
March 21, 2024 at 11:20 am #15435889

susseC

i am getting this error : PHP Warning: preg_match(): Unknown modifier '-' in httpdocs/wp-content/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php on line 186
we are using wp bakery
both wp bakery and wpml plugins are all updated
I saw a similar issue here : https://wpml.org/forums/topic/warning-preg_match-unknown-modifier-2/
can you let me know a fix for the same?

March 21, 2024 at 12:10 pm #15436186

susseC

can you send the mail to ganpat@tekhne.nl as well?

March 21, 2024 at 12:40 pm #15436331

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Can you please try the following:

1. Open the file located at `/plugins/sitepress-multilingual-cms/inc/absolute-links/absolute-links.class.php`.
2. Navigate to line 186, you will find this piece of code:

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

3. Replace it with the updated code snippet:

if ( preg_match( "#^" . preg_quote($match, '#') . "#", $request_match, $matches ) || preg_match( "#^" . preg_quote($match, '#') . "#", urldecode( $request_match ), $matches ) ) {

Does it help?

We can't send to another email, it gets sent to your WPML email automatically.

March 22, 2024 at 1:31 pm #15440823

susseC

HI Bruno thanks for the code above, this worked for me, after adding this code i dont see the errors logged anymore. so thats a great news for me.

Now my next question/concern is do we need to keep record of this change somewhere at our end and make the same changes on every next plugin update?

Or is its already a change that is slotted to be released in the next version to come?

March 25, 2024 at 8:51 am #15445108

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

https://wpml.org/errata/php-warning-preg_match-unknown-modifier/

Based on the content of our development ticket, it's uncertain whether the change will be included in the upcoming version. However, this could shift depending on the number of reported cases, potentially prioritizing its implementation.

The topic ‘[Closed] PHP Warning: preg_match(): Unknown modifier '-' in’ is closed to new replies.