ms-files.php generates bad content-types for REQUEST_URI's with query string
|Reported by:||chrisbliss18||Owned by:|
File requests of the type /subsite/files/style.css?ver=1 produce a bad content-type output. The request has to be for a multisite subsite as the request has to pass through wp-includes/ms-files.php.
The problem is caused by a call to wp_check_filetype that is passed an argument of $_SERVER['REQUEST_URI'] rather than $file. Since this variable contains the querystring of the request, it causes a failure of the regular expressions that are used in wp_check_filetype function.
This problem isn't present for all files as a fallback to mime_content_type is present, and that function is called with the correct argument.
Files with extensions of CSS are good examples of the problem as the mime_content_type function returns a type of text/plain in these cases. However, I have seen some servers that will return content-types such as "text/css?ver=1".
Attached is a patch that fixes this improper argument issue. It is built off of .