Archived topic
PHP 8.1 deprecation notice for generate_set_comment_form_defaults
1 reply · Started by Thomas on January 29, 2023
Hi there,
this code in generate_set_comment_form_defaults:
$defaults['comment_notes_before'] = null;
$defaults['comment_notes_after'] = null;
leads to a deprecation notice:
2023/01/29 12:26:34 [error] 2015302#2015302: *11780826 FastCGI sent in stderr: "PHP message: PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /wp-includes/comment-template.php on line 2512" while reading response header from upstream,
I fixed it locally by replacing null with an empty string "". It would be great if you could upstream that.
Thanks!
Thanks for the heads up! This will be fixed in 3.3: https://github.com/tomusborne/generatepress/pull/505