Ticket #32354: 32354.2.patch
File 32354.2.patch, 1.3 KB (added by , 10 years ago) |
---|
-
wp-includes/functions.php
3681 3681 * @return bool True if SSL, false if not used. 3682 3682 */ 3683 3683 function is_ssl() { 3684 $is_ssl = false; 3684 3685 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 } 3689 3692 } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { 3690 return true; 3693 if ( empty( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ){ 3694 $_SERVER['HTTPS'] = 'on'; 3695 } 3696 $is_ssl = true; 3697 } elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ( 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] )) { 3698 if ( empty( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ){ 3699 $_SERVER['HTTPS'] = 'on'; 3700 } 3701 $is_ssl = true; 3702 } else if (stripos( get_option( 'siteurl' ), 'https://' ) === 0 ) { 3703 if ( empty( $_SERVER['HTTPS'] ) || $_SERVER['HTTPS'] != 'on' ) { 3704 $_SERVER['HTTPS'] = 'on'; 3705 } 3706 $is_ssl = true; 3691 3707 } 3692 return false;3708 return apply_filters( 'is_ssl', $is_ssl ); 3693 3709 } 3694 3710 3695 3711 /**