From 3f1c3dd4caf8434fb85ae0f90e3bc265a3fea08c Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 29 Jun 2014 10:29:14 +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. Built from https://develop.svn.wordpress.org/trunk@28893 git-svn-id: http://core.svn.wordpress.org/trunk@28692 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index bc40f3e62a..8cbe242531 100644 --- a/wp-admin/includes/file.php +++ b/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 ) );