[wp-trac] [WordPress Trac] #63379: Fix for deprecated rtrim passing null to parameter

WordPress Trac noreply at wordpress.org
Thu May 1 17:21:37 UTC 2025


#63379: Fix for deprecated rtrim passing null to parameter
--------------------------------+--------------------------------
 Reporter:  shanemac10          |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Formatting          |     Version:  6.8
 Severity:  normal              |  Resolution:
 Keywords:  needs-testing-info  |     Focuses:  php-compatibility
--------------------------------+--------------------------------

Comment (by shanemac10):

 @SirLouen

 Okay, I made this real quick and tested it, and it causes a critical error
 before getting to the END if you run it. Just add to a functions.php file.

 {{{#!php
 <?php
 add_action('init', function() {
         $test_values = ['', ' test ', null, false, [] ];
         echo '<h2>START</h2>';
         foreach($test_values as $index => $test_value) {
                 $test_output = untrailingslashit( $test_value );
                 echo '<h2>'.$index.' = '.$test_output.'</h2>';
         }
         echo '<h2>END</h2>';
 });
 }}}

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


More information about the wp-trac mailing list