mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-31 13:37:51 +01:00
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
This commit is contained in:
parent
dbdc7a9e83
commit
a8e56e49ec
@ -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$@' =>
|
||||
|
@ -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'];
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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']) );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user