Make WordPress Core

Changeset 3041 for trunk/wp-login.php


Ignore:
Timestamp:
11/11/2005 01:21:28 AM (21 years ago)
Author:
matt
Message:

Add HTTPS support, fixes #1372

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r2985 r3041  
    1212        if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
    1313                $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
    14        
    15         if ( dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
    16                 update_option('siteurl', dirname('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
     14
     15        $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
     16        if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_settings('siteurl') )
     17                update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );
    1718}
    1819
Note: See TracChangeset for help on using the changeset viewer.