git-svn-id: http://svn.automattic.com/wordpress/trunk@12926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3e0f3f54d6
commit
998704b8d7
|
@ -4,7 +4,7 @@ RewriteBase BASE/
|
|||
#uploaded files
|
||||
RewriteRule ^(.*/)?files/$ index.php [L]
|
||||
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
|
||||
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
|
||||
RewriteRule ^(.*/)?files/(.*) wp-includes/blogs.php?file=$2 [L]
|
||||
|
||||
# add a trailing slash to /wp-admin
|
||||
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
if ( !defined( 'MEDIA_FILE' ) ) {
|
||||
if ( !defined( 'SHORTINIT' ) ) {
|
||||
define( 'SHORTINIT', true ); // this prevents most of WP from being loaded
|
||||
require_once( dirname( dirname( __FILE__) ) . '/wp-load.php' ); // absolute includes are faster
|
||||
}
|
||||
|
@ -66,10 +66,7 @@ function wp_check_filetype($filename, $mimes = null) {
|
|||
}
|
||||
endif;
|
||||
|
||||
if ( defined( 'MEDIA_FILE' ) )
|
||||
$file = BLOGUPLOADDIR . str_replace( '..', '', MEDIA_FILE );
|
||||
else
|
||||
$file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] );
|
||||
$file = BLOGUPLOADDIR . str_replace( '..', '', $_GET[ 'file' ] );
|
||||
if ( !is_file( $file ) ) {
|
||||
status_header( 404 );
|
||||
die('404 — File not found.');
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
/**
|
||||
* Load mulitsite uploaded media
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Multisite
|
||||
*/
|
||||
|
||||
define( 'SHORTINIT', true );
|
||||
require_once( dirname( dirname( __FILE__) ) . '/wp-load.php' ); // absolute includes are faster
|
||||
require_once( WP_CONTENT_DIR . '/blogs.php' );
|
||||
exit();
|
|
@ -82,17 +82,6 @@ require( ABSPATH . WPINC . '/plugin.php' );
|
|||
require( ABSPATH . WPINC . '/default-filters.php' );
|
||||
include_once( ABSPATH . WPINC . '/pomo/mo.php' );
|
||||
|
||||
// internalize virtual content rewrite rule
|
||||
if ( is_multisite() && !defined( 'SHORTINIT' ) ) {
|
||||
$media_base = $path . 'files/';
|
||||
$base_len = strlen( $media_base );
|
||||
if ( substr( $_SERVER[ 'REQUEST_URI' ], 0, $media_len ) == $media_base && $media_len < strlen( $_SERVER[ 'REQUEST_URI' ] ) ) {
|
||||
define( 'MEDIA_FILE', substr( $_SERVER[ 'REQUEST_URI' ], $media_len ) );
|
||||
require_once( WP_CONTENT_DIR . '/blogs.php' );
|
||||
exit();
|
||||
}
|
||||
unset( $media_base, $media_len );
|
||||
}
|
||||
// Stop most of WordPress from being loaded if we just want the basics.
|
||||
if ( SHORTINIT )
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue