WordPress.org

Make WordPress Core

Changeset 15749


Ignore:
Timestamp:
10/07/2010 09:00:45 PM (8 years ago)
Author:
westi
Message:

Ensure we don't generate incorrect content types when files are requested with query strings. Fixes #14450 props chrisbliss18.

File:
1 edited

Legend:

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

    r14609 r15749  
    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.