6.0.0-beta1
7/26/25

[#4420] URL paths sometimes duplicated when php run as CGI
Summary URL paths sometimes duplicated when php run as CGI
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester akuretz (at) 3dstickfight (dot) com
Created 09/14/2006 (6890 days ago)
Due
Updated 03/16/2007 (6707 days ago)
Assigned 09/18/2006 (6886 days ago)
Resolved 09/19/2006 (6885 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/16/2007 01:02:24 PM kompostnik (at) o2 (dot) pl Comment #5 Reply to this comment
After changing Horde::selfUrl as proposed it still doesnt work (the 
same problem)...
09/19/2006 04:33:42 AM Chuck Hagenbuch State ⇒ Not A Bug
 
09/18/2006 10:29:43 PM akuretz (at) 3dstickfight (dot) com Comment #4 Reply to this comment
I didn't feel good about ignoring them if they were equal, however it 
worked as a temporary fix for me. I wasn't proposing it as a code fix, 
merely showing what made things work for me.



I have tried cgi.fix_pathinfo=1 and that does indeed seem to resolve 
my issue!  I now have no issues with IMP maintenance, and the Delete 
and Login URL's in MIMP work on my mobile phone. Thanks for this, I 
didn't know how to resolve this issue.
09/18/2006 09:35:23 PM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
Please see http://bugs.php.net/bug.php?id=31843 and similar. I don't 
feel good about ignore PATH_INFO if it's equal to PHP_SELF since even 
though unlikely, that is theoretically a valid PATH_INFO setting 
(especially imagine Chora viewing its own source).



On dreamhost in these circumstances, is there another CGI value that 
has the correct value, or is the problem that PATH_INFO has info it 
shouldn't? Does turning cgi.fix_pathinfo on change anything?
09/18/2006 07:53:20 PM etiennesky (at) yahoo (dot) com Comment #2 Reply to this comment
Hi have the same problem with logging into imp (badredirect after 
maintenance), but also with kronolith when saving an event.



I am also using php-cgi at Dreamhost.



The fix works for me, both in imp and kronolith.



Please fix this for future releases.
09/14/2006 07:52:49 PM akuretz (at) 3dstickfight (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ URL paths sometimes duplicated when php run as CGI
Queue ⇒ Horde Framework Packages
State ⇒ Unconfirmed
Reply to this comment
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.


Saved Queries