WordPress.org

Make WordPress Core

Ticket #13733: 13733.3.diff

File 13733.3.diff, 1.6 KB (added by wpmuguru, 8 years ago)

revision of 13733.2.diff

  • wp-includes/functions.php

     
    21252125        $siteurl = get_option( 'siteurl' );
    21262126        $upload_path = get_option( 'upload_path' );
    21272127        $upload_path = trim($upload_path);
    2128         $main_override = false;
     2128        $main_override = defined( 'MULTISITE' ) && is_main_site();
    21292129        if ( empty($upload_path) ) {
    21302130                $dir = WP_CONTENT_DIR . '/uploads';
    21312131        } else {
    21322132                $dir = $upload_path;
    21332133                if ( 'wp-content/uploads' == $upload_path ) {
    21342134                        $dir = WP_CONTENT_DIR . '/uploads';
    2135                         $main_override = defined( 'MULTISITE' ) && is_main_site();
    21362135                } elseif ( 0 !== strpos($dir, ABSPATH) ) {
    21372136                        // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
    21382137                        $dir = path_join( ABSPATH, $dir );
     
    21462145                        $url = trailingslashit( $siteurl ) . $upload_path;
    21472146        }
    21482147
    2149         if ( defined('UPLOADS') && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
     2148        if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    21502149                $dir = ABSPATH . UPLOADS;
    21512150                $url = trailingslashit( $siteurl ) . UPLOADS;
    21522151        }
    21532152
    2154         if ( is_multisite() && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
     2153        if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    21552154                if ( defined( 'BLOGUPLOADDIR' ) )
    21562155                        $dir = untrailingslashit(BLOGUPLOADDIR);
    21572156                $url = str_replace( UPLOADS, 'files', $url );