preg_match() PHP v8.1 Compatibility
-
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)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.