is_ssl() improvements. Props johnbillion. fixes #8641 for 2.7

git-svn-id: http://svn.automattic.com/wordpress/branches/2.7@10218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-12-17 17:58:31 +00:00
parent 6d524de74d
commit a659936a4f

View File

@ -2804,7 +2804,15 @@ function validate_file( $file, $allowed_files = '' ) {
* @return bool True if SSL, false if not used.
*/
function is_ssl() {
return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
if ( isset($_SERVER['HTTPS']) ) {
if ( 'on' == strtolower($_SERVER['HTTPS']) )
return true;
if ( '1' == $_SERVER['HTTPS'] )
return true;
} elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
return true;
}
return false;
}
/**