Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r14854 r15197  
    12861286    fwrite( $out_fp,  $response['body']);
    12871287    fclose($out_fp);
     1288    clearstatcache();
    12881289
    12891290    return $headers;
     
    21252126    $upload_path = get_option( 'upload_path' );
    21262127    $upload_path = trim($upload_path);
    2127     $main_override = false;
     2128    $main_override = defined( 'MULTISITE' ) && is_main_site();
    21282129    if ( empty($upload_path) ) {
    21292130        $dir = WP_CONTENT_DIR . '/uploads';
     
    21322133        if ( 'wp-content/uploads' == $upload_path ) {
    21332134            $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 || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
     2148    if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    21492149        $dir = ABSPATH . UPLOADS;
    21502150        $url = trailingslashit( $siteurl ) . UPLOADS;
    21512151    }
    21522152
    2153     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 ) ) {
    21542154        if ( defined( 'BLOGUPLOADDIR' ) )
    21552155            $dir = untrailingslashit(BLOGUPLOADDIR);
     
    23052305    @fwrite( $ifp, $bits );
    23062306    fclose( $ifp );
     2307    clearstatcache();
     2308
    23072309    // Set correct file permissions
    23082310    $stat = @ stat( dirname( $new_file ) );
     
    23102312    $perms = $perms & 0000666;
    23112313    @ chmod( $new_file, $perms );
     2314    clearstatcache();
    23122315
    23132316    // Compute the URL
Note: See TracChangeset for help on using the changeset viewer.