Make WordPress Core


Ignore:
Timestamp:
09/18/2012 06:07:18 PM (12 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-default-constants.php

    r21881 r21892  
    2525        return;
    2626
    27     /** @since 3.0.0 */
    2827    // Base uploads dir relative to ABSPATH
    2928    if ( !defined( 'UPLOADBLOGSDIR' ) )
    3029        define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
    3130
    32     /** @since 3.0.0 */
    33     if ( !defined( 'UPLOADS' ) ) {
     31    // The main site in a post-MU network uses wp-content/uploads.
     32    // This used to be handled in wp_upload_dir() by ignoring UPLOADS for this case. Avoid defining it instead.
     33    if ( ! defined( 'UPLOADS' ) ) {
     34        if ( ! ( is_main_site() && defined( 'MULTISITE' ) ) )
     35            define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
     36
    3437        // Uploads dir relative to ABSPATH
    35         define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
    3638        if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
    3739            define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
Note: See TracChangeset for help on using the changeset viewer.