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:
parent
306dc7e646
commit
3f1c3dd4ca
|
@ -79,8 +79,8 @@ function get_file_description( $file ) {
|
||||||
* @return string Full filesystem path to the root of the WordPress installation
|
* @return string Full filesystem path to the root of the WordPress installation
|
||||||
*/
|
*/
|
||||||
function get_home_path() {
|
function get_home_path() {
|
||||||
$home = get_option( 'home' );
|
$home = set_url_scheme( get_option( 'home' ), 'http' );
|
||||||
$siteurl = get_option( 'siteurl' );
|
$siteurl = set_url_scheme( get_option( 'siteurl' ), 'http' );
|
||||||
if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
|
if ( ! empty( $home ) && 0 !== strcasecmp( $home, $siteurl ) ) {
|
||||||
$wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
|
$wp_path_rel_to_home = str_ireplace( $home, '', $siteurl ); /* $siteurl - $home */
|
||||||
$pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
|
$pos = strripos( str_replace( '\\', '/', $_SERVER['SCRIPT_FILENAME'] ), trailingslashit( $wp_path_rel_to_home ) );
|
||||||
|
|
Loading…
Reference in New Issue