mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-11 02:49:04 +01:00
is_ssl() improvements. Props johnbillion. fixes #8641 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@10217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
158b45fb7b
commit
bdb67d76ee
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user