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

Bug #1858 Relative redirects don't work
Submitted: 2004-07-12 22:01 UTC
From: fred at eggheads dot ca Assigned: mike
Status: Closed Package: HTTP
PHP Version: 4.3.7 OS: FreeBSD 5.2.1
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-12 22:01 UTC] fred at eggheads dot ca
Description: ------------ HTTP::redirect("x.php"); does not work. Trailing slash removed from path name before redirect. From http://x.com/directory/ redirecting to x.php results in http://x.com/directoryx.php instead of http://x.com/directory/x.php Reproduce code: --------------- HTTP::redirect("x.php"); Patch that fixes problem. --- HTTP.php.orig Mon Jul 12 14:53:43 2004 +++ HTTP.php Mon Jul 12 14:53:06 2004 @@ -296,6 +296,10 @@ } else { $path = dirname($_SERVER['PHP_SELF']); } + // Ensure path ends in '/' + if ($path{strlen($path)} != '/') { + $path .= '/'; + } return $server . strtr($path, '\\', '/') . $url; } Expected result: ---------------- redirect to http://servername/test/x.php Actual result: -------------- redirect to http://servername/testx.php

Comments

 [2004-07-14 08:10 UTC] mike
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/HTTP