WordPress.org

Make WordPress Core

Changeset 13427


Ignore:
Timestamp:
02/26/10 06:21:47 (5 years ago)
Author:
nacin
Message:

Use is_ssl() in place of manual SERVERHTTPS? == 'on' checks. fixes #11885

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r13377 r13427  
    225225 
    226226        $this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME'])); 
    227         $this->app_base = get_bloginfo('url') . '/' . $this->script_name . '/'; 
    228         if ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { 
    229             $this->app_base = preg_replace( '/^http:\/\//', 'https://', $this->app_base ); 
    230         } 
     227        $this->app_base = home_url( $this->script_name . '/' ); 
    231228 
    232229        $this->selectors = array( 
  • trunk/wp-includes/canonical.php

    r13377 r13427  
    4343    if ( !$requested_url ) { 
    4444        // build the URL in the address bar 
    45         $requested_url  = ( !empty($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
     45        $requested_url  = is_ssl() ? 'https://' : 'http://'; 
    4646        $requested_url .= $_SERVER['HTTP_HOST']; 
    4747        $requested_url .= $_SERVER['REQUEST_URI']; 
  • trunk/wp-includes/functions.php

    r13413 r13427  
    33383338        $url = WP_SITEURL; 
    33393339    } else { 
    3340         $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
     3340        $schema = is_ssl() ? 'https://' : 'http://'; 
    33413341        $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); 
    33423342    } 
  • trunk/wp-login.php

    r13242 r13427  
    340340        $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); 
    341341 
    342     $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; 
     342    $schema = is_ssl() ? 'https://' : 'http://'; 
    343343    if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') ) 
    344344        update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); 
Note: See TracChangeset for help on using the changeset viewer.