[Tickets #4420] NEW: URL paths sometimes duplicated when php run as CGI

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Sep 14 12:52:51 PDT 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4420
-----------------------------------------------------------------------
 Ticket             | 4420
 Created By         | akuretz at 3dstickfight.com
 Summary            | URL paths sometimes duplicated when php run as CGI
 Queue              | Horde Framework Packages
 Version            | HEAD
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Owners             | 
-----------------------------------------------------------------------


akuretz at 3dstickfight.com (2006-09-14 12:52) wrote:

Jan Schneider asked me to open this ticket. This problem originally
occurred using MIMP, and then I observed it when IMP tried to perform it's
maintenance. The problem is that I'd sometimes get URL's like this:
http://www.server.com/horde/imp/redirect.php/horde/imp/redirect.php?nocache=6de35ay90a68&maintenance_done=1&domaintenance=1
and
http://www.server.com/horde/index.php?url=http%3A%2F%2Fwww.server.com%2Fhorde%2Fmimp%2Findex.php%2Fhorde%2Fmimp%2Findex.php%3Fnocache%3D5310v7zf1jsw

Below is my email from the MIMP mail list, describing what I found and how
I fixed it.

I think I found something, may be just an issue with the way my
server (Dreamhost) works. I found that the Delete url gets
constructed differently than the rest of the links in the Menu
section; it's created by Util::addParameter which uses Horde::selfUrl.

In Horde::selfUrl, the first check is if the script is running as
CGI (I had to recompile php to use Imp on Dreamhost, so it's
executing as CGI). The problem occurs when the url is constructed
with the script parameters:
if ($script_params) {
if (!empty($_SERVER['PATH_INFO'])) {
if($_SERVER['PATH_INFO'] == $_SERVER['PHP_SELF'])
{
//              print "<br><br>Blah!<br><br>\n";
} else {
$url .= $_SERVER['PATH_INFO'];
}
}
if (!empty($_SERVER['QUERY_STRING'])) {
$url .= '?' . $_SERVER['QUERY_STRING'];
}
}

I added the if check for PATH_INFO == PHP_SELF. Basically, the
/horde/mimp/message.php (PATH_INFO) was getting appended to $url
which already was set to /horde/mimp/message.php (PHP_SELF). My
silly fix seems to work for the few cases I tried, and Imp seems to
still function ok. Again, not fully tested.

I'm guessing this is an issue due to the way my server is working,
or else I'm fixing something that's not really a bug, but is shown
due to a problem elsewhere.





More information about the bugs mailing list