Use is_ssl() in place of manual SERVER['HTTPS'] == 'on' checks. fixes #11885

git-svn-id: https://develop.svn.wordpress.org/trunk@13427 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-02-26 06:21:47 +00:00
parent 9a033bf679
commit e7fa18385a
4 changed files with 4 additions and 7 deletions

View File

@ -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$@' =>

View File

@ -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'];
}

View File

@ -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;

View File

@ -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']) );
}