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

Bug #19315 removeDotSegments("0") not working
Submitted: 2012-03-04 09:18 UTC
From: tkli Assigned: tkli
Status: Closed Package: Net_URL2 (version SVN)
PHP Version: 5.3.10 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2012-03-04 09:18 UTC] tkli (Tom Klingenberg)
Description: ------------ The removeDotSegments has an implementation flaw taking the string "0" as empty (bool check instead of strlen). Test script: --------------- echo Net_URL2::removeDotSegments("0"); # empty, not "0" Expected result: ---------------- 0

Comments

 [2012-03-04 09:24 UTC] tkli (Tom Klingenberg)
I can't upload patches, so as comment: Index: Net/URL2.php =================================================================== --- Net/URL2.php (revision 323857) +++ Net/URL2.php (revision ) @@ -757,7 +757,7 @@ // Make sure not to be trapped in an infinite loop due to a bug in this // method $j = 0; - while ($path && $j++ < 100) { + while (strlen($path) && $j++ < 100) { if (substr($path, 0, 2) == './') { // Step 2.A $path = substr($path, 2);
 [2013-04-19 12:39 UTC] tkli (Tom Klingenberg)
Please close this ticket. The issue has been resolved in the Fork of this package and it will be merged when this package moves to Github. https://github.com/ktomk/Net_URL2/issues/1
 [2013-04-26 02:19 UTC] tkli (Tom Klingenberg)
Fix committed in fb91fb772cfe4008bac44bc28ae547be04f96fdb (pear:master) 3 days ago.
 [2013-12-25 06:30 UTC] tkli (Tom Klingenberg)
-Status: Open +Status: Closed -Assigned To: +Assigned To: tkli
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/get/