WordPress.org

Make WordPress Core

Changeset 23002


Ignore:
Timestamp:
12/03/2012 10:24:06 PM (5 years ago)
Author:
ryan
Message:

Properly set the base URL for the main site when ms-files rewriting is enabled for MU-era installs.

Props nacin
fixes #22702

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r22736 r23002  
    15381538            //   2) we are not switched, as ms_upload_constants() hardcodes
    15391539            //      these constants to reflect the original blog ID.
     1540            //
     1541            // Rather than UPLOADS, we actually use BLOGUPLOADDIR if it is set, as it is absolute.
     1542            // (And it will be set, see ms_upload_constants().) Otherwise, UPLOADS can be used, as
     1543            // as it is relative to ABSPATH. For the final piece: when UPLOADS is used with ms-files
     1544            // rewriting in multisite, the resulting URL is /files. (#WP22702 for background.)
    15401545
    15411546            if ( defined( 'BLOGUPLOADDIR' ) )
    15421547                $dir = untrailingslashit( BLOGUPLOADDIR );
    1543             $url = str_replace( untrailingslashit( UPLOADS ), 'files', $url );
     1548            else
     1549                $dir = ABSPATH . UPLOADS;
     1550            $url = trailingslashit( $siteurl ) . 'files';
    15441551        }
    15451552    }
Note: See TracChangeset for help on using the changeset viewer.