Make WordPress Core

Changeset 21797


Ignore:
Timestamp:
09/10/2012 07:37:08 PM (12 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r21681 r21797  
    29822982 */
    29832983function wp_guess_url() {
    2984     if ( defined('WP_SITEURL') && '' != WP_SITEURL )
     2984    if ( defined('WP_SITEURL') && '' != WP_SITEURL ) {
    29852985        $url = WP_SITEURL;
    2986     else
    2987         $url = set_url_scheme( preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ) );
     2986    } else {
     2987        $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet
     2988        $url = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     2989    }
    29882990
    29892991    return rtrim($url, '/');
Note: See TracChangeset for help on using the changeset viewer.