Ticket #28487: 28487.is_ssl.diff
File 28487.is_ssl.diff, 1.1 KB (added by , 11 years ago) |
---|
-
src/wp-includes/functions.php
3360 3360 } 3361 3361 3362 3362 /** 3363 * Determine if SSL is used .3363 * Determine if SSL is used for either the current request or the provided URL. 3364 3364 * 3365 3365 * @since 2.6.0 3366 3366 * 3367 * @return bool True if SSL, false if not used. 3367 * @param string $url Optional. 3368 * @return bool True if the $url param or current request is SSL, false if not used. 3368 3369 */ 3369 function is_ssl() { 3370 function is_ssl( $url = null ) { 3371 if ( ! empty( $url ) ) { 3372 return ( 'https' === @parse_url( $url, PHP_URL_SCHEME ) ); 3373 } 3374 3370 3375 if ( isset($_SERVER['HTTPS']) ) { 3371 if ( 'on' == strtolower( $_SERVER['HTTPS']) )3376 if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) { 3372 3377 return true; 3373 if ( '1' == $_SERVER['HTTPS'] ) 3378 } 3379 if ( '1' == $_SERVER['HTTPS'] ) { 3374 3380 return true; 3375 } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { 3381 } 3382 } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { 3376 3383 return true; 3377 3384 } 3385 3378 3386 return false; 3379 3387 } 3380 3388