• Resolved Oliver Campion

    (@domainsupport)


    With PHP v8.1 we are seeing a crazy number of these in debug.log …

    [01-Feb-2025 02:04:01 UTC] E_DEPRECATED: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/rules.php on line 913

    Please can you update /vendor/wordfence/wf-waf/src/lib/rules.php that file so that instead of …

    if (@preg_match('/' . $rule . '/iS', null) === false) {
    continue; //This PCRE version can't compile the rule
    }

    … you use …

    if (@preg_match('/' . $rule . '/iS', '') === false) {
    continue; //This PCRE version can't compile the rule
    }

    That should allow compatibility with PHP v8.1 but retain the intended behaviour.

    Thank you.

    Oliver

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support wfscott

    (@wfscott)

    Oliver,

    Thanks for reaching out and for the feedback. We’ve added a case to address this in a future release. Normally the message is suppressed by the @ operator, but if there is a custom error handler involved it is possible that is causing it to be logged.

    Thanks,
    Scott

    Thread Starter Oliver Campion

    (@domainsupport)

    Thanks Scott. We log all errors on this particular site to make sure there are no issues down the line.

    Oliver

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.