[wp-trac] [WordPress Trac] #52241: Infinite loop in clean_dirsize_cache()

WordPress Trac noreply at wordpress.org
Wed Jan 6 21:03:13 UTC 2021


#52241: Infinite loop in clean_dirsize_cache()
--------------------------+-----------------------------
 Reporter:  raubvogel     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.6
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Since WP 5.6 there exsists
 {{{#!php
 <?php
 function clean_dirsize_cache( $path ){}
 }}}
 at [https://core.trac.wordpress.org/browser/branches/5.6/src/wp-
 includes/functions.php#L7725 functions.php:7725].
 There we have
 {{{#!php
 <?php
         while ( DIRECTORY_SEPARATOR !== $path && '.' !== $path && '..' !==
 $path ) {
                 $path = dirname( $path );
                 unset( $directory_cache[ $path ] );
         }
 }}}
 at [https://core.trac.wordpress.org/browser/branches/5.6/src/wp-
 includes/functions.php#L7735 functions.php:7735] which loops „forever“ if
 `$path` is something like `c:\dir\subdir` on Windows.
 {{{#!php
 <?php
 $path = dirname( $path );
 }}}
 returns the parent path in each step and gets „stuck“ at `c:\`.

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


More information about the wp-trac mailing list