Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15197 r14854  
    12861286    fwrite( $out_fp,  $response['body']);
    12871287    fclose($out_fp);
    1288     clearstatcache();
    12891288
    12901289    return $headers;
     
    21262125    $upload_path = get_option( 'upload_path' );
    21272126    $upload_path = trim($upload_path);
    2128     $main_override = defined( 'MULTISITE' ) && is_main_site();
     2127    $main_override = false;
    21292128    if ( empty($upload_path) ) {
    21302129        $dir = WP_CONTENT_DIR . '/uploads';
     
    21332132        if ( 'wp-content/uploads' == $upload_path ) {
    21342133            $dir = WP_CONTENT_DIR . '/uploads';
     2134            $main_override = defined( 'MULTISITE' ) && is_main_site();
    21352135        } elseif ( 0 !== strpos($dir, ABSPATH) ) {
    21362136            // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
     
    21462146    }
    21472147
    2148     if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
     2148    if ( defined('UPLOADS') && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
    21492149        $dir = ABSPATH . UPLOADS;
    21502150        $url = trailingslashit( $siteurl ) . UPLOADS;
    21512151    }
    21522152
    2153     if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
     2153    if ( is_multisite() && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
    21542154        if ( defined( 'BLOGUPLOADDIR' ) )
    21552155            $dir = untrailingslashit(BLOGUPLOADDIR);
     
    23052305    @fwrite( $ifp, $bits );
    23062306    fclose( $ifp );
    2307     clearstatcache();
    2308 
    23092307    // Set correct file permissions
    23102308    $stat = @ stat( dirname( $new_file ) );
     
    23122310    $perms = $perms & 0000666;
    23132311    @ chmod( $new_file, $perms );
    2314     clearstatcache();
    23152312
    23162313    // Compute the URL
Note: See TracChangeset for help on using the changeset viewer.