From 961a962a3cf029429562c8f5a8e4340f503bc412 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 21 Nov 2012 07:08:38 +0000 Subject: [PATCH] Remove trailing slashes from UPLOADS before trying a str_replace() in wp_upload_dir(). props jbrinley. fixes #22469 * In 3.4.x, both $url and UPLOADS had trailing slashes * Due to refactoring, $url is no longer expected to have a trailing slash * Because of the mismatch, the str_replace() was not working, resulting in an incorrectly verbose upload dir URL git-svn-id: https://develop.svn.wordpress.org/trunk@22736 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e64f6f9469..ac814f9fe9 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1540,7 +1540,7 @@ function wp_upload_dir( $time = null ) { if ( defined( 'BLOGUPLOADDIR' ) ) $dir = untrailingslashit( BLOGUPLOADDIR ); - $url = str_replace( UPLOADS, 'files', $url ); + $url = str_replace( untrailingslashit( UPLOADS ), 'files', $url ); } }