WordPress.org

Plugin Directory

Changeset 685582


Ignore:
Timestamp:
03/22/13 10:00:31 (13 months ago)
Author:
donncha
Message:
  • Replace HTTPS checks with is_ssl() checks
  • Fix typo in Javascript login loader
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wordpress-mu-domain-mapping/trunk/domain_mapping.php

    r673229 r685582  
    441441    } 
    442442 
    443     if ( false == isset( $_SERVER[ 'HTTPS' ] ) ) 
    444         $_SERVER[ 'HTTPS' ] = 'Off'; 
    445     $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://'; 
     443    $protocol = is_ssl() ? 'https://' : 'http://'; 
    446444    $domains = $wpdb->get_results( "SELECT * FROM {$wpdb->dmtable} WHERE blog_id = '{$wpdb->blogid}'", ARRAY_A ); 
    447445    if ( is_array( $domains ) && !empty( $domains ) ) { 
     
    534532 
    535533        $wpdb->suppress_errors( $s ); 
    536         if ( false == isset( $_SERVER[ 'HTTPS' ] ) ) 
    537             $_SERVER[ 'HTTPS' ] = 'Off'; 
    538         $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://'; 
     534        $protocol = is_ssl() ? 'https://' : 'http://'; 
    539535        if ( $domain ) { 
    540536            $return_url[ $wpdb->blogid ] = untrailingslashit( $protocol . $domain  ); 
     
    569565            $orig_url = get_blog_option( $blog_id, $url ); 
    570566        } 
    571         if ( isset( $_SERVER[ 'HTTPS' ] ) && 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) { 
     567        if ( is_ssl() ) { 
    572568            $orig_url = str_replace( "http://", "https://", $orig_url ); 
    573569        } else { 
     
    679675    global $current_site, $current_blog, $wpdb; 
    680676    $wpdb->dmtablelogins = $wpdb->base_prefix . 'domain_mapping_logins'; 
    681     if ( false == isset( $_SERVER[ 'HTTPS' ] ) ) 
    682         $_SERVER[ 'HTTPS' ] = 'Off'; 
    683     $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://'; 
     677    $protocol = is_ssl() ? 'https://' : 'http://'; 
    684678    $hash = get_dm_hash(); 
    685679    $key = md5( time() ); 
     
    705699        return; 
    706700 
    707     if ( !isset( $_SERVER[ 'HTTPS' ] ) ) 
    708         $_SERVER[ 'HTTPS' ] = 'off'; 
    709     $protocol = ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) ? 'https://' : 'http://'; 
     701    $protocol = is_ssl() ? 'https://' : 'http://'; 
    710702    $url = domain_mapping_siteurl( false ); 
    711703    if ( $url && $url != untrailingslashit( $protocol . $current_blog->domain . $current_blog->path ) ) { 
     
    737729    $wpdb->dmtablelogins = $wpdb->base_prefix . 'domain_mapping_logins'; 
    738730    $hash = get_dm_hash(); 
    739     if ( false == isset( $_SERVER[ 'HTTPS' ] ) ) 
    740         $_SERVER[ 'HTTPS' ] = 'Off'; 
    741     $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://'; 
     731    $protocol = is_ssl() ? 'https://' : 'http://'; 
    742732    if ( $_GET[ 'dm' ] == $hash ) { 
    743733        if ( $_GET[ 'action' ] == 'load' ) { 
     
    783773        return false; 
    784774 
    785     if ( false == isset( $_SERVER[ 'HTTPS' ] ) ) 
    786         $_SERVER[ 'HTTPS' ] = 'Off'; 
    787     $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://'; 
     775    $protocol = is_ssl() ? 'https://' : 'http://'; 
    788776    $hash = get_dm_hash(); 
    789     echo "<script src='//{$current_site->domain}{$current_site->path}?dm={$hash}&amp;action=load&amp;blogid={$current_blog->blog_id}&amp;siteid={$current_blog->site_id}&amp;t=" . mt_rand() . "&amp;back=" . urlencode( $protocol . $current_blog->domain . $_SERVER[ 'REQUEST_URI' ] ) . "' type='text/javascript'></script>"; 
     777    echo "<script src='{$protocol}{$current_site->domain}{$current_site->path}?dm={$hash}&amp;action=load&amp;blogid={$current_blog->blog_id}&amp;siteid={$current_blog->site_id}&amp;t=" . mt_rand() . "&amp;back=" . urlencode( $protocol . $current_blog->domain . $_SERVER[ 'REQUEST_URI' ] ) . "' type='text/javascript'></script>"; 
    790778} 
    791779 
Note: See TracChangeset for help on using the changeset viewer.