• Resolved Valentin Bora

    (@valentinbora)


    The RegEx within addons/lib/helper.php seems to encounter an error when parsing scripts echo’ed via wp_head action.

    I’ve called preg_last_error() when $updated_scripts returns NULL, which returns PREG_JIT_STACKLIMIT_ERROR. I’ve sprinkled the function with some debug logging, which I’m happy to share:

    https://gist.github.com/valentinbora/09a2254f362e54096bb1c035c7454728

    Cookiebot version: 2.0.3
    Wordpress: 4.9.8
    PHP 7.2.9

    P.S. For now, I’ve applied somewhat of a bandaid at the end of the function:

    if ($updated_scripts === null) {
        $updated_scripts = $buffer;
    }
    
    return $updated_scripts;
    • This topic was modified 7 years, 8 months ago by Valentin Bora.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author aytac

    (@aytac)

    Hello Valentin,

    We created a ticket in github to handle this issue, you can find it here: ticket.

    We have added a commit to basically update the regex pattern to use less steps/memory. Can you test it on your website and report back to us?

    Take care,

    Aytac

    Thread Starter Valentin Bora

    (@valentinbora)

    Thanks @aytac, let’s continue the discussion over at GitHub.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘RegEx error in cookiebot_addons_manipulate_script’ is closed to new replies.