• Resolved wp_kc

    (@wp_kc)


    Environment:
    Apache/2.4.65
    PHP 8.4.15
    WordPress 6.8.3

    On my development server, I found over 4MB of PHP warnings like this…

    [24-Nov-2025 19:23:56 UTC] PHP Warning:  preg_match(): Compilation failed: digits missing after \x or in \x{} or \o{} or \N{U+} at offset 30 in /var/www/wp-content/plugins/media-sync/includes/MediaSync.class.php on line 1103

    When I look at where that is happening I find this…

    $is_ignored = preg_match('/(-scaled|[_-]\d+x\d+)|@[2-6]\x(?=\.[a-z]{3,4}$)|\.[a-z]{3,4}.webp/im', $file_name) == true;

    I suppose “\x” could be interpreted as a literal letter “x” or as the start of a hex code. It looks like you wanted it to be a literal letter x. You could get rid of the warning by just eliminating the slash in front of the x, just like you did in the first alternative, “\d+x\d+”

    $is_ignored = preg_match('/(-scaled|[_-]\d+x\d+)|@[2-6]x(?=\.[a-z]{3,4}$)|\.[a-z]{3,4}.webp/im', $file_name) == true;

    Thanks for a really useful utility!

Viewing 1 replies (of 1 total)
  • Plugin Author erolsk8

    (@erolsk8)

    Hey @wp_kc,

    This exact change has been sitting locally for a while, but now I finally pushed a new version. Please let me know if it’s solved now in 1.4.9.

    Thank you for such a detailed explanation. I wasn’t aware it was causing so many logs. But yes, it is for each file, so it can be a lot.

    Kind regards,

    Erol

Viewing 1 replies (of 1 total)

The topic ‘preg_match() digits missing after \x’ is closed to new replies.