From bdb67d76eecf34cd56533b287b1ff114454b781e Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 17 Dec 2008 17:58:07 +0000 Subject: [PATCH] is_ssl() improvements. Props johnbillion. fixes #8641 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@10217 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 79fd2800b..92251fdb2 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2035,10 +2035,13 @@ function wp_check_filetype( $filename, $mimes = null ) { // Accepted MIME types are set here as PCRE unless provided. $mimes = ( is_array( $mimes ) ) ? $mimes : apply_filters( 'upload_mimes', array( 'jpg|jpeg|jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', - 'tif|tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', 'ico' => 'image/x-icon', 'asf|asx|wax|wmv|wmx' => 'video/asf', 'avi' => 'video/avi', @@ -2804,7 +2807,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; } /**