From 2600c2816932017bce5eb27fd3e619f58ca1e34f Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Fri, 10 Jun 2016 18:56:31 +0000 Subject: [PATCH] Boostrap: Move `is_ssl()` to wp-includes/load.php. Moving to load.php introduces parity with other commonly evaluated `is_*()` functions such as `is_admin()` or `is_multisite()`. It also makes `is_ssl()` available much earlier in the loading process, such as for use in drop-ins like advanced-cache.php. Props johnjamesjacoby. Fixes #35844. Built from https://develop.svn.wordpress.org/trunk@37677 git-svn-id: http://core.svn.wordpress.org/trunk@37643 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 19 ------------------- wp-includes/load.php | 23 +++++++++++++++++++++++ wp-includes/version.php | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index ca5b8af285..878ed7c902 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4052,25 +4052,6 @@ function validate_file( $file, $allowed_files = '' ) { return 0; } -/** - * Determine if SSL is used. - * - * @since 2.6.0 - * - * @return bool True if SSL, false if not used. - */ -function is_ssl() { - 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; -} - /** * Whether to force SSL used for the Administration Screens. * diff --git a/wp-includes/load.php b/wp-includes/load.php index f474c5c87e..54ed0400be 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -949,3 +949,26 @@ function wp_installing( $is_installing = null ) { return (bool) $installing; } + +/** + * Determines if SSL is used. + * + * @since 2.6.0 + * @since 4.6.0 Moved from functions.php to load.php + * + * @return bool True if SSL, otherwise false. + */ +function is_ssl() { + 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; +} diff --git a/wp-includes/version.php b/wp-includes/version.php index 11fc71db1c..3828d80be5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37676'; +$wp_version = '4.6-alpha-37677'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.