[wp-trac] [WordPress Trac] #54997: PHP8.1 throw 'deprecated' in WordPress 6.0-alpha-52650

WordPress Trac noreply at wordpress.org
Sun Jan 30 13:21:50 UTC 2022


#54997: PHP8.1 throw 'deprecated' in WordPress 6.0-alpha-52650
----------------------------+-----------------------------
 Reporter:  haozi           |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  General         |    Version:  trunk
 Severity:  normal          |   Keywords:  has-patch
  Focuses:  administration  |
----------------------------+-----------------------------
 In PHP8.1,WordPress will throw rtrim(): Passing null to parameter #1
 ($string) of type string is deprecated

 To fix it, I try to add (string) in /wp-includes/formatting.php on line
 2761 like:
 {{{#!php
         return rtrim( (string) $string, '/\\' );
 }}}
 It works well!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54997>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list