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
This commit is contained in:
dd32 2010-10-02 03:08:02 +00:00
parent b05ad69f63
commit 26bf32ac3e
2 changed files with 4 additions and 7 deletions

View File

@ -3483,7 +3483,7 @@ function wp_guess_url() {
$schema = is_ssl() ? 'https://' : 'http://'; $schema = is_ssl() ? 'https://' : 'http://';
$url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
} }
return $url; return rtrim($url, '/');
} }
/** /**

View File

@ -419,12 +419,9 @@ function wp_not_installed() {
if ( ! is_blog_installed() && ! defined( 'WP_INSTALLING' ) ) if ( ! is_blog_installed() && ! defined( 'WP_INSTALLING' ) )
wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); 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' ) ) { } 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'; $link = wp_guess_url() . '/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';
require( ABSPATH . WPINC . '/kses.php' ); require( ABSPATH . WPINC . '/kses.php' );
require( ABSPATH . WPINC . '/pluggable.php' ); require( ABSPATH . WPINC . '/pluggable.php' );
require( ABSPATH . WPINC . '/formatting.php' ); require( ABSPATH . WPINC . '/formatting.php' );