Changeset 49744 for trunk/src/wp-includes/functions.php
- Timestamp:
- 12/03/2020 08:37:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r49693 r49744 7627 7627 function recurse_dirsize( $directory, $exclude = null, $max_execution_time = null, &$directory_cache = null ) { 7628 7628 $directory = untrailingslashit( $directory ); 7629 $cache_path = untrailingslashit( str_replace( ABSPATH, '', $directory ) );7630 7631 7629 $save_cache = false; 7632 7630 … … 7636 7634 } 7637 7635 7638 if ( isset( $directory_cache[ $ cache_path] ) ) {7639 return $directory_cache[ $ cache_path];7636 if ( isset( $directory_cache[ $directory ] ) && is_int( $directory_cache[ $directory ] ) ) { 7637 return $directory_cache[ $directory ]; 7640 7638 } 7641 7639 … … 7706 7704 } 7707 7705 7708 $directory_cache[ $ cache_path] = $size;7706 $directory_cache[ $directory ] = $size; 7709 7707 7710 7708 // Only write the transient on the top level call and not on recursive calls. … … 7732 7730 } 7733 7731 7734 $ cache_path = untrailingslashit( str_replace( ABSPATH, '', $path ));7735 unset( $directory_cache[ $ cache_path ] );7736 7737 while ( DIRECTORY_SEPARATOR !== $ cache_path && '.' !== $cache_path && '..' !== $cache_path ) {7738 $ cache_path = dirname( $cache_path );7739 unset( $directory_cache[ $ cache_path ] );7732 $path = untrailingslashit( $path ); 7733 unset( $directory_cache[ $path ] ); 7734 7735 while ( DIRECTORY_SEPARATOR !== $path && '.' !== $path && '..' !== $path ) { 7736 $path = dirname( $path ); 7737 unset( $directory_cache[ $path ] ); 7740 7738 } 7741 7739
Note: See TracChangeset
for help on using the changeset viewer.