Changeset 49616
- Timestamp:
- 11/16/2020 10:29:42 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r49212 r49616 929 929 930 930 if ( is_multisite() ) { 931 invalidate_dirsize_cache( $new_file );931 clean_dirsize_cache( $new_file ); 932 932 } 933 933 -
trunk/src/wp-includes/functions.php
r49580 r49616 2748 2748 2749 2749 if ( is_multisite() ) { 2750 invalidate_dirsize_cache( $new_file );2750 clean_dirsize_cache( $new_file ); 2751 2751 } 2752 2752 … … 7629 7629 7630 7630 $directory = untrailingslashit( $directory ); 7631 $cache_path = normalize_dirsize_cache_path( $directory ); 7631 $cache_path = untrailingslashit( str_replace( ABSPATH, '', $directory ) ); 7632 7632 7633 $save_cache = false; 7633 7634 … … 7723 7724 * @param string $path Full path of a directory or file. 7724 7725 */ 7725 function invalidate_dirsize_cache( $path ) {7726 function clean_dirsize_cache( $path ) { 7726 7727 $directory_cache = get_transient( 'dirsize_cache' ); 7727 7728 … … 7730 7731 } 7731 7732 7732 $cache_path = normalize_dirsize_cache_path( $path);7733 $cache_path = untrailingslashit( str_replace( ABSPATH, '', $path ) ); 7733 7734 unset( $directory_cache[ $cache_path ] ); 7734 7735 … … 7739 7740 7740 7741 set_transient( 'dirsize_cache', $directory_cache ); 7741 }7742 7743 /**7744 * Normalize dirsize cache path.7745 *7746 * Ensures array keys within the dirsize_cache transient follow the same format.7747 *7748 * @since 5.6.07749 *7750 * @param string $path7751 * @return string7752 */7753 function normalize_dirsize_cache_path( $path ) {7754 $path = str_replace( ABSPATH, '', $path );7755 7756 return untrailingslashit( $path );7757 7742 } 7758 7743 -
trunk/src/wp-includes/post.php
r49595 r49616 5919 5919 5920 5920 if ( is_multisite() ) { 5921 invalidate_dirsize_cache( $file );5921 clean_dirsize_cache( $file ); 5922 5922 } 5923 5923
Note: See TracChangeset
for help on using the changeset viewer.