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
This commit is contained in:
dd32 2012-01-06 13:46:22 +00:00
parent 3abb558ae8
commit e15f5275a8
1 changed files with 1 additions and 1 deletions

View File

@ -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 {