Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: domain_mapping.php
- ===================================================================
- --- domain_mapping.php (revision 464429)
- +++ domain_mapping.php (working copy)
- @@ -449,9 +449,7 @@
- return false;
- }
- - if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
- - $_SERVER[ 'HTTPS' ] = 'Off';
- - $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://';
- + $protocol = is_ssl() ? 'https://' : 'http://';
- $domains = $wpdb->get_results( "SELECT * FROM {$wpdb->dmtable} WHERE blog_id = '{$wpdb->blogid}'", ARRAY_A );
- if ( is_array( $domains ) && !empty( $domains ) ) {
- $orig_url = parse_url( get_original_url( 'siteurl' ) );
- @@ -542,9 +540,7 @@
- }
- $wpdb->suppress_errors( $s );
- - if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
- - $_SERVER[ 'HTTPS' ] = 'Off';
- - $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://';
- + $protocol = is_ssl() ? 'https://' : 'http://';
- if ( $domain ) {
- $return_url[ $wpdb->blogid ] = untrailingslashit( $protocol . $domain );
- $setting = $return_url[ $wpdb->blogid ];
- @@ -577,7 +573,7 @@
- } else {
- $orig_url = get_blog_option( $blog_id, $url );
- }
- - if ( isset( $_SERVER[ 'HTTPS' ] ) && 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) {
- + if ( is_ssl() ) {
- $orig_url = str_replace( "http://", "https://", $orig_url );
- } else {
- $orig_url = str_replace( "https://", "http://", $orig_url );
- @@ -690,9 +686,7 @@
- function remote_logout_loader() {
- global $current_site, $current_blog, $wpdb;
- $wpdb->dmtablelogins = $wpdb->base_prefix . 'domain_mapping_logins';
- - if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
- - $_SERVER[ 'HTTPS' ] = 'Off';
- - $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://';
- + $protocol = is_ssl() ? 'https://' : 'http://';
- $hash = get_dm_hash();
- $key = md5( time() );
- $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->dmtablelogins} ( `id`, `user_id`, `blog_id`, `t` ) VALUES( %s, 0, %d, NOW() )", $key, $current_blog->blog_id ) );
- @@ -704,9 +698,7 @@
- function redirect_to_mapped_domain() {
- global $current_blog, $wpdb;
- - if ( !isset( $_SERVER[ 'HTTPS' ] ) )
- - $_SERVER[ 'HTTPS' ] = 'off';
- - $protocol = ( 'on' == strtolower($_SERVER['HTTPS']) ) ? 'https://' : 'http://';
- + $protocol = is_ssl() ? 'https://' : 'http://';
- $url = domain_mapping_siteurl( false );
- if ( $url && $url != untrailingslashit( $protocol . $current_blog->domain . $current_blog->path ) ) {
- $redirect = get_site_option( 'dm_301_redirect' ) ? '301' : '302';
- @@ -736,9 +728,7 @@
- $wpdb->dmtablelogins = $wpdb->base_prefix . 'domain_mapping_logins';
- $hash = get_dm_hash();
- - if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
- - $_SERVER[ 'HTTPS' ] = 'Off';
- - $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://';
- + $protocol = is_ssl() ? 'https://' : 'http://';
- if ( $_GET[ 'dm' ] == $hash ) {
- if ( $_GET[ 'action' ] == 'load' ) {
- if ( !is_user_logged_in() )
- @@ -782,9 +772,7 @@
- if ( 0 == get_site_option( 'dm_remote_login' ) || is_user_logged_in() )
- return false;
- - if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
- - $_SERVER[ 'HTTPS' ] = 'Off';
- - $protocol = ( 'on' == strtolower( $_SERVER[ 'HTTPS' ] ) ) ? 'https://' : 'http://';
- + $protocol = is_ssl() ? 'https://' : 'http://';
- $hash = get_dm_hash();
- echo "<script src='{$protocol}{$current_site->domain}{$current_site->path}?dm={$hash}&action=load&blogid={$current_blog->blog_id}&siteid={$current_blog->site_id}&t=" . mt_rand() . "&back=" . urlencode( $protocol . $current_blog->domain . $_SERVER[ 'REQUEST_URI' ] ) . "' type='text/javascript'></script>";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement