Make WordPress Core

Ticket #11998: 11998.2.patch

File 11998.2.patch, 952 bytes (added by ocean90, 15 years ago)

used isset and removed $GLOBALS

  • wp-includes/functions.php

     
    21362136                        $url = trailingslashit( $siteurl ) . $upload_path;
    21372137        }
    21382138
    2139         if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) ) {
     2139        if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( isset( $switched ) && $switched === false ) ) {
    21402140                $dir = ABSPATH . UPLOADS;
    21412141                $url = trailingslashit( $siteurl ) . UPLOADS;
    21422142        }
    21432143
    2144         if ( is_multisite() && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) ) {
     2144        if ( is_multisite() && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( isset( $switched ) && $switched === false ) ) {
    21452145                if ( defined( 'BLOGUPLOADDIR' ) )
    21462146                        $dir = untrailingslashit(BLOGUPLOADDIR);
    21472147                $url = str_replace( UPLOADS, 'files', $url );