Deprecations for preg_match, preg_replace_callback and null argument
derikb opened this issue · 0 comments
derikb commented
Seeing this in php8.2
1 PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/DOMLex.php on line 57
1 PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php on line 373
1 PHP Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php on line 139
Looks like all are cases of the code expecting a string but somewhere allowing null.
php docs do not indicate when this was deprecated, just indicates those parameters should be string|array.
Probably somewhere further up the stack a null check could clear this up.