diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/ms-files.php --- a/wp/wp-includes/ms-files.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/ms-files.php Tue Dec 15 13:49:49 2020 +0100 @@ -9,7 +9,7 @@ */ define( 'SHORTINIT', true ); -require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); +require_once dirname( __DIR__ ) . '/wp-load.php'; if ( ! is_multisite() ) { die( 'Multisite support not enabled' ); @@ -19,7 +19,7 @@ error_reporting( 0 ); -if ( $current_blog->archived == '1' || $current_blog->spam == '1' || $current_blog->deleted == '1' ) { +if ( '1' == $current_blog->archived || '1' == $current_blog->spam || '1' == $current_blog->deleted ) { status_header( 404 ); die( '404 — File not found.' ); } @@ -41,12 +41,12 @@ $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 ); } -header( 'Content-Type: ' . $mimetype ); // always send this +header( 'Content-Type: ' . $mimetype ); // Always send this. if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) { header( 'Content-Length: ' . filesize( $file ) ); } -// Optional support for X-Sendfile and X-Accel-Redirect +// Optional support for X-Sendfile and X-Accel-Redirect. if ( WPMU_ACCEL_REDIRECT ) { header( 'X-Accel-Redirect: ' . str_replace( WP_CONTENT_DIR, '', $file ) ); exit; @@ -61,7 +61,7 @@ header( 'ETag: ' . $etag ); header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' ); -// Support for Conditional GET - use stripslashes to avoid formatting.php dependency +// Support for conditional GET - use stripslashes() to avoid formatting.php dependency. $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false; if ( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { @@ -69,7 +69,7 @@ } $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ); -// If string is empty, return 0. If not, attempt to parse into a timestamp +// If string is empty, return 0. If not, attempt to parse into a timestamp. $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0; // Make a timestamp for our most recent modification... @@ -83,6 +83,6 @@ exit; } -// If we made it this far, just serve the file +// If we made it this far, just serve the file. readfile( $file ); flush();