WordPress.org

Make WordPress Core

Changeset 12926


Ignore:
Timestamp:
02/02/10 16:32:19 (4 years ago)
Author:
wpmuguru
Message:

pass #2 change uploaded media rewrite rule, props nacin, see #11742

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/htaccess.ms

    r12884 r12926  
    55RewriteRule ^(.*/)?files/$ index.php [L] 
    66RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* 
    7 RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L] 
     7RewriteRule ^(.*/)?files/(.*) wp-includes/blogs.php?file=$2 [L] 
    88 
    99# add a trailing slash to /wp-admin 
  • trunk/wp-content/blogs.php

    r12924 r12926  
    11<?php 
    2 if ( !defined( 'MEDIA_FILE' ) ) { 
     2if ( !defined( 'SHORTINIT' ) ) { 
    33    define( 'SHORTINIT', true ); // this prevents most of WP from being loaded 
    44    require_once( dirname( dirname( __FILE__) ) . '/wp-load.php' ); // absolute includes are faster 
     
    6767endif; 
    6868 
    69 if ( defined( 'MEDIA_FILE' ) ) 
    70     $file = BLOGUPLOADDIR . str_replace( '..', '', MEDIA_FILE ); 
    71 else 
    72     $file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] ); 
     69$file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] ); 
    7370if ( !is_file( $file ) ) { 
    7471    status_header( 404 ); 
  • trunk/wp-settings.php

    r12924 r12926  
    8383include_once( ABSPATH . WPINC . '/pomo/mo.php' ); 
    8484 
    85 // internalize virtual content rewrite rule 
    86 if ( is_multisite() && !defined( 'SHORTINIT' ) ) { 
    87     $media_base = $path . 'files/'; 
    88     $base_len = strlen( $media_base ); 
    89     if ( substr( $_SERVER[ 'REQUEST_URI' ], 0, $media_len ) == $media_base && $media_len < strlen( $_SERVER[ 'REQUEST_URI' ] ) ) { 
    90         define( 'MEDIA_FILE', substr( $_SERVER[ 'REQUEST_URI' ], $media_len ) ); 
    91         require_once( WP_CONTENT_DIR . '/blogs.php' ); 
    92         exit(); 
    93     } 
    94     unset( $media_base, $media_len ); 
    95 } 
    9685// Stop most of WordPress from being loaded if we just want the basics. 
    9786if ( SHORTINIT ) 
Note: See TracChangeset for help on using the changeset viewer.