[wp-trac] [WordPress Trac] #59275: PHP 8.1 Deprecated function: rtrim(): Passing null to parameter

WordPress Trac noreply at wordpress.org
Wed Jul 10 18:14:35 UTC 2024


#59275: PHP 8.1 Deprecated function: rtrim(): Passing null to parameter
--------------------------+--------------------------------
 Reporter:  srishtis      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Formatting    |     Version:  6.2.2
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:  php-compatibility
--------------------------+--------------------------------
Changes (by hellofromTonya):

 * status:  assigned => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hello @srishtis,

 Welcome to WordPress Core's Trac :)

 I'm sorry it's taken this long for someone to action on your ticket.

 Thank you for providing the call stack with the deprecation notice. This
 is very helpful and much appreciated.

 Looking at these calls:
 {{{
 wp-includes/formatting.php:2809
 rtrim()
 wp-includes/formatting.php:2809
 untrailingslashit()
 wp-includes/formatting.php:2794
 trailingslashit()
 }}}

 each of these functions requires a non-nullable `string`. Passing `null`
 to any of them is incorrect. Thus the deprecation notice being thrown is
 correct and (somewhat) informative to alert of the incorrect data type.

 What's passing `null` to them? Looking at the call stack, http-concat
 must-use is invoking `trailingslashit()` here:
 {{{
 wp-content/mu-plugins/http-concat/concat-utils.php:27
 WPCOM_Concat_Utils::realpath()
 }}}

 Something on the site or within that must-use is likely the root cause,
 with what's known in this ticket.

 What's the next step?

 I'd advise opening a support ticket with WPCOM hosting for them to
 investigate what's happening and why.

 I'll close this ticket as `invalid`. Though that
 https://make.wordpress.org/core/handbook/contribute/trac/#ticket-
 properties resolution term might seem harsh], what it means is: the ticket
 appears to be a support request, rather than a bug within the WordPress
 Core source code.

 What if WPCOM advises the root cause is within Core itself?

 Then please reopen this ticket and provide the details they shared as well
 as other information such as a step-by-step instructions on how to
 reproduce the issue. This kind of information helps contributors attempt
 to reproduce the issue as the starting point for diagnosing what might be
 happening.

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


More information about the wp-trac mailing list