Make WordPress Core

Ticket #32354: 32354.patch

File 32354.patch, 1.2 KB (added by chriscct7, 10 years ago)
  • wp-includes/functions.php

     
    36813681 * @return bool True if SSL, false if not used.
    36823682 */
    36833683function is_ssl() {
     3684        $is_ssl = false;
    36843685        if ( isset($_SERVER['HTTPS']) ) {
    3685                 if ( 'on' == strtolower($_SERVER['HTTPS']) )
    3686                         return true;
    3687                 if ( '1' == $_SERVER['HTTPS'] )
    3688                         return true;
     3686                if ( 'on' == strtolower($_SERVER['HTTPS']) ) {
     3687                        $is_ssl = true;
     3688                }
     3689                if ( '1' == $_SERVER['HTTPS'] ) {
     3690                        $is_ssl = true;
     3691                }
    36893692        } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
    3690                 return true;
     3693                $is_ssl = true;
     3694        } elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ( 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] )) {
     3695                if ( empty( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ){
     3696                        $_SERVER['HTTPS'] = 'on';
     3697                }
     3698                $is_ssl = true;
     3699        } else if (stripos( get_option( 'siteurl' ), 'https://' ) === 0 ) {
     3700                if ( empty( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ) {
     3701                        $_SERVER['HTTPS'] = 'on';
     3702                }
     3703                $is_ssl = true;
    36913704        }
    3692         return false;
     3705        return apply_filters( 'is_ssl', $is_ssl );
    36933706}
    36943707
    36953708/**