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.

git-svn-id: https://develop.svn.wordpress.org/trunk@28893 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2014-06-29 10:28:52 +00:00
parent 075be3e54b
commit 3426416dac
1 changed files with 2 additions and 2 deletions

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 ) );