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

Bug #2325 absoluteURI() causes a notice when called from command line
Submitted: 2004-09-14 10:04 UTC
From: pure Assigned: mike
Status: Closed Package: HTTP
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2004-09-14 10:04 UTC] pure
Description: ------------ In Package HTTP-1.3.2 HTTP::absoluteURI() raises a notice when called from the command line. Reproduce code: --------------- php -r "require_once('HTTP.php'); echo HTTP::absoluteURI('www.google.com');" The error occures in HTTP.php on line 283($port = $_SERVER['SERVER_PORT'];). $_SERVER['SERVER_PORT'] is not set when running php from command line. This *could* help: $port = isset($_SERVER['SERVER_PORT']) ? : $_SERVER['SERVER_PORT'] : 80 ; Expected result: ---------------- PEAR Error or some default values. Actual result: -------------- Notice: Undefined index: SERVER_PORT in c:\web\html\pear\HTTP.php on line 283 http://localhost./www.google.com

Comments

 [2004-09-14 10:20 UTC] mike
Seems pretty senseless to call absoluteUri() or redirect() from command line...?
 [2004-09-21 15:03 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.