Normalise the schemes used in get_home_path() so it returns the correct path for sites using SSL in the admin area but not the front end. Fixes #25767. Props GregLone for the initial patch.

Built from https://develop.svn.wordpress.org/trunk@28893


git-svn-id: http://core.svn.wordpress.org/trunk@28692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-06-29 10:29:14 +00:00
parent 306dc7e646
commit 3f1c3dd4ca

View File

@ -79,8 +79,8 @@ function get_file_description( $file ) {
* @return string Full filesystem path to the root of the WordPress installation
*/
function get_home_path() {
$home = get_option( 'home' );
$siteurl = get_option( 'siteurl' );
$home = set_url_scheme( get_option( 'home' ), 'http' );
$siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
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'] ), trailingslashit( $wp_path_rel_to_home ) );