WordPress.org

Make WordPress Core

Ticket #14450: 14450.diff

File 14450.diff, 842 bytes (added by chrisbliss18, 4 years ago)

Updated to replace other $_SERVERREQUEST_URI? instances with $file

  • wp-includes/ms-files.php

    diff --git a/wp-includes/ms-files.php b/wp-includes/ms-files.php
    index f5af8e0..5ec6d1d 100644
    a b if ( !is_file( $file ) ) { 
    2929        die( '404 — File not found.' ); 
    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 ); 
    3535 
    3636if( $mime[ 'type' ] ) 
    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 
    4242if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) )