Site logo

[Resolved] PHP 8.1 deprecation notice for generate_set_comment_form_defaults

Home Forums Support [Resolved] PHP 8.1 deprecation notice for generate_set_comment_form_defaults

Home Forums Support PHP 8.1 deprecation notice for generate_set_comment_form_defaults

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2512924
    Thomas

    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!

    #2513605
    Tom
    Lead Developer
    Lead Developer

    Thanks for the heads up! This will be fixed in 3.3: https://github.com/tomusborne/generatepress/pull/505

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