[wp-trac] [WordPress Trac] #60982: warnings with php 8.1

WordPress Trac noreply at wordpress.org
Fri Apr 19 20:03:52 UTC 2024


#60982: warnings with php 8.1
--------------------------+------------------------
 Reporter:  yus0          |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  duplicate
 Keywords:  php81         |     Focuses:
--------------------------+------------------------
Changes (by sabernhardt):

 * keywords:  php81 reporter-feedback => php81
 * resolution:  invalid => duplicate
 * milestone:  Awaiting Review =>


Old description:

> With php v8.1 and WordPress v6.5.2 I receive warnings in admin area:
>
>  PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject)
> of type
>  array|string is deprecated in /wp-includes/functions.php on line 7241
>
>  PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject)
> of type
>  array|string is deprecated in /wp-includes/functions.php on line 2187
>
>  PHP Deprecated:  strip_tags(): Passing null to parameter #1 ($string) of
> type string is
>  deprecated in \wp-admin\admin-header.php on line 36
>
> They all are easily fixable, so I just hope somebody will add fixes to
> next update:
>   https://prnt.sc/SXP6CYRUswtz
>   https://prnt.sc/-XgEBobeohgn
>   https://prnt.sc/GiNK_lL4cwxX

New description:

 With php v8.1 and WordPress v6.5.2 I receive warnings in admin area:
 {{{
  PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject)
 of type
  array|string is deprecated in /wp-includes/functions.php on line 7241
 }}}
 {{{
  PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject)
 of type
  array|string is deprecated in /wp-includes/functions.php on line 2187
 }}}
 {{{
  PHP Deprecated:  strip_tags(): Passing null to parameter #1 ($string) of
 type string is
  deprecated in \wp-admin\admin-header.php on line 36
 }}}

 They all are easily fixable, so I just hope somebody will add fixes to
 next update:

 https://prnt.sc/SXP6CYRUswtz
 https://prnt.sc/-XgEBobeohgn
 https://prnt.sc/GiNK_lL4cwxX

--

Comment:

 #57580 is also about `null` parameter(s) in the `add_submenu_page`
 function.

 (My first patch there could have silenced errors too, but plugin authors
 need to know that `null` does not work well.)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60982#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list