Make WordPress Core

Changeset 16632


Ignore:
Timestamp:
11/30/2010 08:44:08 PM (14 years ago)
Author:
nacin
Message:

Ensure we don't generate incorrect content types when files are requested with query strings. props chrisbliss18. fixes #14450 for the 3.0 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-includes/ms-files.php

    r14609 r16632  
    3030}
    3131
    32 $mime = wp_check_filetype( $_SERVER[ 'REQUEST_URI' ] );
     32$mime = wp_check_filetype( $file );
    3333if( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) )
    3434    $mime[ 'type' ] = mime_content_type( $file );
     
    3737    $mimetype = $mime[ 'type' ];
    3838else
    39     $mimetype = 'image/' . substr( $_SERVER[ 'REQUEST_URI' ], strrpos( $_SERVER[ 'REQUEST_URI' ], '.' ) + 1 );
     39    $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );
    4040
    4141header( 'Content-type: ' . $mimetype ); // always send this
Note: See TracChangeset for help on using the changeset viewer.