From e15f5275a84f9c9cc9453be6c08ef9c0f0a2d7f4 Mon Sep 17 00:00:00 2001 From: dd32 Date: Fri, 6 Jan 2012 13:46:22 +0000 Subject: [PATCH] Fix edge case in get_home_path() where the incorrect path may be returned. Props ptahdunbar. Fixes #18768 git-svn-id: http://svn.automattic.com/wordpress/trunk@19697 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 796948c1e..b7c6e4bc6 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -81,7 +81,7 @@ function get_home_path() { $siteurl = get_option( 'siteurl' ); if ( $home != '' && $home != $siteurl ) { $wp_path_rel_to_home = str_replace($home, '', $siteurl); /* $siteurl - $home */ - $pos = strpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home); + $pos = strrpos($_SERVER["SCRIPT_FILENAME"], $wp_path_rel_to_home); $home_path = substr($_SERVER["SCRIPT_FILENAME"], 0, $pos); $home_path = trailingslashit( $home_path ); } else {