From 23667bf07e6f9f0d24077616767c781d2292ec52 Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Sat, 15 May 2010 21:53:18 +0000 Subject: [PATCH] don't check upload_path in upgraded MU install, see #12549 git-svn-id: http://svn.automattic.com/wordpress/trunk@14680 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 709cc5c7bd..cf1c0dbdfa 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2117,12 +2117,14 @@ function wp_upload_dir( $time = null ) { $siteurl = get_option( 'siteurl' ); $upload_path = get_option( 'upload_path' ); $upload_path = trim($upload_path); + $main_override = false; if ( empty($upload_path) ) { $dir = WP_CONTENT_DIR . '/uploads'; } else { $dir = $upload_path; if ( 'wp-content/uploads' == $upload_path ) { $dir = WP_CONTENT_DIR . '/uploads'; + $main_override = defined( 'MULTISITE' ) && is_main_site(); } elseif ( 0 !== strpos($dir, ABSPATH) ) { // $dir is absolute, $upload_path is (maybe) relative to ABSPATH $dir = path_join( ABSPATH, $dir ); @@ -2136,12 +2138,12 @@ function wp_upload_dir( $time = null ) { $url = trailingslashit( $siteurl ) . $upload_path; } - if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) { + if ( defined('UPLOADS') && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) { $dir = ABSPATH . UPLOADS; $url = trailingslashit( $siteurl ) . UPLOADS; } - if ( is_multisite() && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) { + if ( is_multisite() && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) { if ( defined( 'BLOGUPLOADDIR' ) ) $dir = untrailingslashit(BLOGUPLOADDIR); $url = str_replace( UPLOADS, 'files', $url );