@@ -1296,7 +1296,7 @@ function toggleLayer( whichLayer ) {
12961296 wp_nonce_field ('wp-cache ' );
12971297 echo "</form> \n" ;
12981298
1299- if ( ( defined ( ' VHOST ' ) || defined ( ' SUBDOMAIN_INSTALL ' ) || defined ( ' SUNRISE ' ) || ( defined ( ' WP_ALLOW_MULTISITE ' ) && constant ( ' WP_ALLOW_MULTISITE ' ) == true ) ) && wpsupercache_site_admin () ) {
1299+ if ( is_multisite ( ) && wpsupercache_site_admin () ) {
13001300 echo '<form name="wp_cache_content_delete" action="#listfiles" method="post"> ' ;
13011301 echo '<input type="hidden" name="wp_delete_all_cache" /> ' ;
13021302 echo '<div class="submit"><input id="deleteallpost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value=" ' . __ ( 'Delete Cache On All Blogs ' , 'wp-super-cache ' ) . '" /></div> ' ;
@@ -2856,7 +2856,7 @@ function wp_cache_delete_buttons() {
28562856 echo '<div class="submit" style="float:left;margin-left:10px"><input id="deletepost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value=" ' . __ ( 'Delete Cache ' , 'wp-super-cache ' ) . '" /></div> ' ;
28572857 wp_nonce_field ('wp-cache ' );
28582858 echo "</form> \n" ;
2859- if ( ( defined ( ' VHOST ' ) || defined ( ' SUBDOMAIN_INSTALL ' ) || defined ( ' SUNRISE ' ) || ( defined ( ' WP_ALLOW_MULTISITE ' ) && constant ( ' WP_ALLOW_MULTISITE ' ) == true ) ) && wpsupercache_site_admin () ) {
2859+ if ( is_multisite ( ) && wpsupercache_site_admin () ) {
28602860 echo '<form name="wp_cache_content_delete" action="#listfiles" method="post"> ' ;
28612861 echo '<input type="hidden" name="wp_delete_all_cache" /> ' ;
28622862 echo '<div class="submit" style="float:left;margin-left:10px"><input id="deleteallpost" class="button-secondary" type="submit" ' . SUBMITDISABLED . 'value=" ' . __ ( 'Delete Cache On All Blogs ' , 'wp-super-cache ' ) . '" /></div> ' ;
@@ -2992,6 +2992,8 @@ function wp_cache_clean_legacy_files( $dir, $file_prefix ) {
29922992 return false ;
29932993
29942994 if ( $ handle = @opendir ( $ dir ) ) {
2995+ $ curr_blog_id = is_multisite () ? get_current_blog_id () : false ;
2996+
29952997 while ( false !== ( $ file = readdir ( $ handle ) ) ) {
29962998 if ( is_file ( $ dir . $ file ) == false || $ file == 'index.html ' ) {
29972999 continue ;
@@ -3004,8 +3006,9 @@ function wp_cache_clean_legacy_files( $dir, $file_prefix ) {
30043006 @unlink ( $ dir . 'meta/ ' . str_replace ( '.html ' , '.meta ' , $ file ) );
30053007 } else {
30063008 $ meta = json_decode ( wp_cache_get_legacy_cache ( $ dir . 'meta/ ' . $ file ), true );
3007- if ( ( defined ( ' VHOST ' ) || defined ( ' SUBDOMAIN_INSTALL ' ) || defined ( ' SUNRISE ' ) || ( defined ( ' WP_ALLOW_MULTISITE ' ) && constant ( ' WP_ALLOW_MULTISITE ' ) == true ) ) && $ meta [ 'blog_id ' ] != $ wpdb -> blogid )
3009+ if ( $ curr_blog_id && $ curr_blog_id ! == ( int ) $ meta ['blog_id ' ] ) {
30083010 continue ;
3011+ }
30093012 @unlink ( $ dir . $ file );
30103013 @unlink ( $ dir . 'meta/ ' . $ file );
30113014 }
0 commit comments