From 26bf32ac3e0cc0cce4325fc8ba1014201d1bcc6c Mon Sep 17 00:00:00 2001 From: dd32 Date: Sat, 2 Oct 2010 03:08:02 +0000 Subject: [PATCH] utilise wp_guess_url() in installation redirection to provide an Absolute URL. See #14062. See #14904 git-svn-id: http://svn.automattic.com/wordpress/trunk@15680 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- wp-includes/load.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 7443acdc1..c2d7253ce 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3483,7 +3483,7 @@ function wp_guess_url() { $schema = is_ssl() ? 'https://' : 'http://'; $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } - return $url; + return rtrim($url, '/'); } /** diff --git a/wp-includes/load.php b/wp-includes/load.php index 03b994290..c4fdc476c 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -419,12 +419,9 @@ function wp_not_installed() { if ( ! is_blog_installed() && ! defined( 'WP_INSTALLING' ) ) wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); } elseif ( ! is_blog_installed() && false === strpos( $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) { - if ( defined( 'WP_SITEURL' ) ) - $link = WP_SITEURL . '/wp-admin/install.php'; - elseif ( false !== strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) ) - $link = preg_replace( '|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php'; - else - $link = preg_replace( '|/[^/]+?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php'; + + $link = wp_guess_url() . '/wp-admin/install.php'; + require( ABSPATH . WPINC . '/kses.php' ); require( ABSPATH . WPINC . '/pluggable.php' ); require( ABSPATH . WPINC . '/formatting.php' );