WordPress.org

Make WordPress Core

Ticket #22702: 22702.3.diff

File 22702.3.diff, 1.0 KB (added by nacin, 17 months ago)
  • wp-includes/functions.php

     
    15371537                        //      as wp-content/uploads is used there, and 
    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        } 
    15461553