From a8e56e49ecd80bf02dde0f9dd776d363151fbb71 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 26 Feb 2010 06:21:47 +0000 Subject: [PATCH] Use is_ssl() in place of manual SERVER['HTTPS'] == 'on' checks. fixes #11885 git-svn-id: http://svn.automattic.com/wordpress/trunk@13427 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-app.php | 5 +---- wp-includes/canonical.php | 2 +- wp-includes/functions.php | 2 +- wp-login.php | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/wp-app.php b/wp-app.php index b95a0102d3..d3d81de884 100644 --- a/wp-app.php +++ b/wp-app.php @@ -224,10 +224,7 @@ class AtomServer { function AtomServer() { $this->script_name = array_pop(explode('/',$_SERVER['SCRIPT_NAME'])); - $this->app_base = get_bloginfo('url') . '/' . $this->script_name . '/'; - if ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { - $this->app_base = preg_replace( '/^http:\/\//', 'https://', $this->app_base ); - } + $this->app_base = home_url( $this->script_name . '/' ); $this->selectors = array( '@/service$@' => diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 2c8a1e6d2c..ab9a20d5a6 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -42,7 +42,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { if ( !$requested_url ) { // build the URL in the address bar - $requested_url = ( !empty($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $requested_url = is_ssl() ? 'https://' : 'http://'; $requested_url .= $_SERVER['HTTP_HOST']; $requested_url .= $_SERVER['REQUEST_URI']; } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index a4a408db3b..a2642d673a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3337,7 +3337,7 @@ function wp_guess_url() { if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { $url = WP_SITEURL; } else { - $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $schema = is_ssl() ? 'https://' : 'http://'; $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } return $url; diff --git a/wp-login.php b/wp-login.php index cb5cdd85c5..b378485965 100644 --- a/wp-login.php +++ b/wp-login.php @@ -339,7 +339,7 @@ if ( defined('RELOCATE') ) { // Move flag is set if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); - $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $schema = is_ssl() ? 'https://' : 'http://'; if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') ) update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); }