Don't use set_url_scheme() in wp_guess_url(). wp_guess_url() is used during install before set_url_scheme() is loaded. Props SergeyBiryukov. fixes #20759

git-svn-id: http://core.svn.wordpress.org/trunk@21797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2012-09-10 19:37:08 +00:00
parent 40543db45f
commit 8f1f88a82a
1 changed files with 5 additions and 3 deletions

View File

@ -2981,10 +2981,12 @@ function force_ssl_admin( $force = null ) {
* @return string * @return string
*/ */
function wp_guess_url() { function wp_guess_url() {
if ( defined('WP_SITEURL') && '' != WP_SITEURL ) if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
$url = WP_SITEURL; $url = WP_SITEURL;
else } else {
$url = set_url_scheme( preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) ); $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet
$url = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
}
return rtrim($url, '/'); return rtrim($url, '/');
} }