From a659936a4fca70b3ee5c1a7cac0813553962115b Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 17 Dec 2008 17:58:31 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 79fd2800b9..de8c89cbc9 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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; } /**