From 7e5c6cb03150f18f77e01bf90717a01837f95e8c Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 7 Oct 2010 21:00:45 +0000 Subject: [PATCH] Ensure we don't generate incorrect content types when files are requested with query strings. Fixes #14450 props chrisbliss18. git-svn-id: http://svn.automattic.com/wordpress/trunk@15749 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-files.php b/wp-includes/ms-files.php index f5af8e0370..5ec6d1ddc1 100644 --- a/wp-includes/ms-files.php +++ b/wp-includes/ms-files.php @@ -29,14 +29,14 @@ if ( !is_file( $file ) ) { die( '404 — File not found.' ); } -$mime = wp_check_filetype( $_SERVER[ 'REQUEST_URI' ] ); +$mime = wp_check_filetype( $file ); if( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) ) $mime[ 'type' ] = mime_content_type( $file ); if( $mime[ 'type' ] ) $mimetype = $mime[ 'type' ]; else - $mimetype = 'image/' . substr( $_SERVER[ 'REQUEST_URI' ], strrpos( $_SERVER[ 'REQUEST_URI' ], '.' ) + 1 ); + $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 ); header( 'Content-type: ' . $mimetype ); // always send this if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) )