From 3426416daccf3a97e7a1559c37afa60f7d40c7f1 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 29 Jun 2014 10:28:52 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index bc40f3e62a..8cbe242531 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -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 ) );