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
|
#uploaded files
|
||||||
RewriteRule ^(.*/)?files/$ index.php [L]
|
RewriteRule ^(.*/)?files/$ index.php [L]
|
||||||
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
|
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
|
# add a trailing slash to /wp-admin
|
||||||
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
|
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if ( !defined( 'MEDIA_FILE' ) ) {
|
if ( !defined( 'SHORTINIT' ) ) {
|
||||||
define( 'SHORTINIT', true ); // this prevents most of WP from being loaded
|
define( 'SHORTINIT', true ); // this prevents most of WP from being loaded
|
||||||
require_once( dirname( dirname( __FILE__) ) . '/wp-load.php' ); // absolute includes are faster
|
require_once( dirname( dirname( __FILE__) ) . '/wp-load.php' ); // absolute includes are faster
|
||||||
}
|
}
|
||||||
|
@ -66,9 +66,6 @@ function wp_check_filetype($filename, $mimes = null) {
|
||||||
}
|
}
|
||||||
endif;
|
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 ) ) {
|
if ( !is_file( $file ) ) {
|
||||||
status_header( 404 );
|
status_header( 404 );
|
||||||
|
|
|
@ -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' );
|
require( ABSPATH . WPINC . '/default-filters.php' );
|
||||||
include_once( ABSPATH . WPINC . '/pomo/mo.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.
|
// Stop most of WordPress from being loaded if we just want the basics.
|
||||||
if ( SHORTINIT )
|
if ( SHORTINIT )
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue