Ticket #32354: 32354.patch
File 32354.patch, 1.2 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 $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; 3691 3704 } 3692 return false;3705 return apply_filters( 'is_ssl', $is_ssl ); 3693 3706 } 3694 3707 3695 3708 /**