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:
parent
40543db45f
commit
8f1f88a82a
|
@ -2981,10 +2981,12 @@ function force_ssl_admin( $force = null ) {
|
|||
* @return string
|
||||
*/
|
||||
function wp_guess_url() {
|
||||
if ( defined('WP_SITEURL') && '' != WP_SITEURL )
|
||||
if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
|
||||
$url = WP_SITEURL;
|
||||
else
|
||||
$url = set_url_scheme( preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
|
||||
} else {
|
||||
$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, '/');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue