From a88a48779727b0faad494fddc305453ef1ae693e Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 21 Nov 2012 22:39:59 +0000 Subject: [PATCH] Correct get_home_path() for cases where WordPress is installed in a subdirectory called /wp/, previously it would match on /wp-admin instead of /wp causing an incorrect return path. Props SergeyBiryukov. Fixes #20449 git-svn-id: https://develop.svn.wordpress.org/trunk@22800 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index e97918e990..942f347f59 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -83,7 +83,7 @@ function get_home_path() { $siteurl = get_option( 'siteurl' ); if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) { $wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */ - $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), $wp_path_rel_to_home); + $pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) ); $home_path = substr( $_SERVER['SCRIPT_FILENAME'], 0, $pos ); $home_path = trailingslashit( $home_path ); } else {