[wp-trac] [WordPress Trac] #14450: ms-files.php generates bad content-types for REQUEST_URI's with query string
WordPress Trac
wp-trac at lists.automattic.com
Thu Jul 29 02:25:54 UTC 2010
#14450: ms-files.php generates bad content-types for REQUEST_URI's with query
string
--------------------------+-------------------------------------------------
Reporter: chrisbliss18 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Multisite | Version: 3.0
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
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 [15473].
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14450>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list