Account for the old 'main override' in wp_upload_dir() for the main site in a post-MU network by declining to define the UPLOADS constant.

Fixes uploads on the main site of a post-MU network that uses ms-files rewriting. see #19235.



git-svn-id: https://develop.svn.wordpress.org/trunk@21892 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-18 18:07:18 +00:00
parent 6bb5d6c032
commit 5358b13ae3
1 changed files with 6 additions and 4 deletions

View File

@ -24,15 +24,17 @@ function ms_upload_constants() {
if ( ! get_site_option( 'ms_files_rewriting' ) ) if ( ! get_site_option( 'ms_files_rewriting' ) )
return; return;
/** @since 3.0.0 */
// Base uploads dir relative to ABSPATH // Base uploads dir relative to ABSPATH
if ( !defined( 'UPLOADBLOGSDIR' ) ) if ( !defined( 'UPLOADBLOGSDIR' ) )
define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
/** @since 3.0.0 */ // The main site in a post-MU network uses wp-content/uploads.
if ( !defined( 'UPLOADS' ) ) { // This used to be handled in wp_upload_dir() by ignoring UPLOADS for this case. Avoid defining it instead.
if ( ! defined( 'UPLOADS' ) ) {
if ( ! ( is_main_site() && defined( 'MULTISITE' ) ) )
define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
// Uploads dir relative to ABSPATH // Uploads dir relative to ABSPATH
define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" ); define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
} }