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

Bug #1036 Improper default port number detection
Submitted: 2004-03-19 14:38 UTC
From: jausions Assigned: richard
Status: Closed Package: Net_URL
PHP Version: Irrelevant OS: All
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 : 48 + 18 = ?

 
 [2004-03-19 14:38 UTC] jausions
Description: ------------ The Net_URL package doesn't handle properly URLs without any specified port number, they all default to port 80. Reproduce code: --------------- <?php require_once('Net/URL.php'); $aURLs = array( 'https://secure.com/', 'ftp://server.org/'); while (list(, $sURL) = each($aURLs)) { ?> new Net_URL(<?php echo $sURL; ?>): <?php print_r(new Net_URL($sURL)); ?> <?php } ?> Expected result: ---------------- new Net_URL(https://secure.com/): net_url Object ( [url] => https://secure.com/ [protocol] => https [username] => [password] => [host] => secure.com [port] => 443 [path] => / [querystring] => Array ( ) [anchor] => [useBrackets] => 1 [user] => [pass] => ) new Net_URL(ftp://server.org/): net_url Object ( [url] => ftp://server.org/ [protocol] => ftp [username] => [password] => [host] => server.org [port] => 21 [path] => / [querystring] => Array ( ) [anchor] => [useBrackets] => 1 [user] => [pass] => ) Actual result: -------------- new Net_URL(https://secure.com/): net_url Object ( [url] => https://secure.com/ [protocol] => https [username] => [password] => [host] => secure.com [port] => 80 [path] => / [querystring] => Array ( ) [anchor] => [useBrackets] => 1 [user] => [pass] => ) new Net_URL(ftp://server.org/): net_url Object ( [url] => ftp://server.org/ [protocol] => ftp [username] => [password] => [host] => server.org [port] => 80 [path] => / [querystring] => Array ( ) [anchor] => [useBrackets] => 1 [user] => [pass] => )

Comments

 [2004-03-19 14:42 UTC] jausions
Submitted relevant patch to pear-dev@lists.php.net -Philippe
 [2004-03-19 14:46 UTC] jausions
HTTP_Request bug #1037 is affected by this bug.
 [2004-05-08 17:33 UTC] richard at phpguru dot org
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/packages.php