From 4fcb87234bbb132a4dee772000a96d838f15459c 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: http://core.svn.wordpress.org/trunk@22736 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 ); } }