Home » HTTP » HTTP » Bug #3421
HTTP::absoluteURI adds slash to short URLs on Windows
Details
| Request #3421 | HTTP::absoluteURI adds slash to short URLs on Windows |
|---|---|
| Submitted | 2005-02-10 01:57 UTC |
| From | bug at halfempty dot org |
| Assigned | mike |
| Status | Closed |
| Package | HTTP |
| PHP Version | 4.3.10 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-02-10 01:57 UTC] bug at halfempty dot org
Description:
------------
On Windows, dirname() (used by HTTP::absoluteURI) will turn "/index.php" to "\". absoluteURI will in turn take that "\", see that there is no "/" at the end of $path and add one. Right before the method ends, you have a $path of "\/". The strtr call will convert that to "//". The double-slashes will confuse forms, firefox, etc. I believe getting "//" when just a "/" is expected and seen on other platform is a bug.
dirname() very nearly serves its purpose in this method, but eventually fails because we're not looking at paths, we're looking at URLs.
Reproduce code:
---------------
// On Windows
HTTP::absoluteURI('/index.php');
Expected result:
----------------
http://server/index.php
Actual result:
--------------
http://server//index.php