[wp-trac] [WordPress Trac] #11885: HTTPS check does not work on 1&1 servers in canonical.php.

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 13 13:50:01 UTC 2010


#11885: HTTPS check does not work on 1&1 servers in canonical.php.
--------------------------+-------------------------------------------------
 Reporter:  d4manek       |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.9.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 In canonical.php, the function redirect_canonical() includes the following
 line to detect and build an HTTPS url:

 $requested_url  = ( !empty($_SERVER['HTTPS'] ) &&
 strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';

 On 1and1.com, this logic does not work because $_SERVER['HTTPS'] is set to
 '1' instead of 'on'. It would be better to use the built-in WordPress
 function is_ssl() in this function, which appears to correctly handle all
 hosting sites. The fix would look like this:

 $requested_url  = is_ssl() ? 'https://' : 'http://';

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11885>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list