Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #3378 absoluteURI always applies https protocol under IIS6
Submitted: 2005-02-04 14:25 UTC
From: pjswaine at alphazero dot freeserve dot co dot uk Assigned: mike
Status: Closed Package: HTTP
PHP Version: 4.3.1 OS: Windows NT
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 38 - 3 = ?

 
 [2005-02-04 14:25 UTC] pjswaine at alphazero dot freeserve dot co dot uk
Description: ------------ On IIS6 absoluteURI() always returns a URI with the https protocol when a relative address is fed in. The problem stems from the environmental setting $_SERVER['HTTPS'] which behaves differently under IIS than under Apache. On Apache $_SERVER['HTTPS'] is not set when the protocol is http, but IIS does set it - to "off". Hence line 288 in version 1.3.3 only checks to see if $_SERVER['HTTPS'] is set, not whether it is set to "on". Reproduce code: --------------- Line 288 of HTTP.php v1.3.3 reads: $protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http'; To fix the issue under IIS it could read: $protocol = (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) === "on") ? 'https' : 'http';

Comments

 [2005-02-07 08:37 UTC] mike
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.