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:
parent
3abb558ae8
commit
e15f5275a8
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue