6.0.0-beta1
9/24/25

[#4846] maint_url doubles up under php5 ran as cgi
Summary maint_url doubles up under php5 ran as cgi
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Duplicate
Priority 1. Low
Owners
Requester brandon.evans (at) gmail (dot) com
Created 01/05/2007 (6837 days ago)
Due
Updated 01/06/2007 (6836 days ago)
Assigned 01/05/2007 (6837 days ago)
Resolved 01/06/2007 (6836 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/06/2007 02:11:57 PM Jan Schneider Comment #4
State ⇒ Duplicate
Reply to this comment
Duplicate of ticket #4151
01/05/2007 08:36:01 PM brandon (dot) evans (at) gmail (dot) com Comment #3 Reply to this comment
Pretty sure this is a duplicate ticket and that this is the fix:
http://us2.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
I just tried turning On/Off the cgi.fix_pathinfo variable with the 
same results.  maint_url is still doubling up.

For the record I am running php 5.1.6



I also verified that without the fix I mentioned $url first becomes 
PHP_SELF then PATH_INFO is added to it when maintenance mode is called.




01/05/2007 07:06:20 AM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Pretty sure this is a duplicate ticket and that this is the fix:

http://us2.php.net/manual/en/ini.core.php#ini.cgi.fix-pathinfo
01/05/2007 12:48:06 AM brandon (dot) evans (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ maint_url doubles up under php5 ran as cgi
Queue ⇒ Horde Framework Packages
State ⇒ Unconfirmed
Reply to this comment
I was experiencing a problem in the latest Horde 3.1.3 where maint_url 
was doubling up when maintenance mode was ran.



e.g. $template->set('maint_url', $maint->getMaintenanceFormURL()); 
from the services/maintenance.php would be returned as



/horde/imp/redirect.php/horde/imp/redirect.php?maintenance_done=1&domaintenance=1



I tracked the problem down to the Horde::selfUrl(true) function call.



in lib/Horde.php selfUrl function.



if called with script_params == true && php_sapi_name(), 0, 3) == 'cgi

$url becomes equal to $_SERVER['PHP_SELF'];

$url = $_SERVER['PHP_SELF'];



Next the code hits "if ($script_params)" and adds 
"$_SERVER['PATH_INFO'];" to $url

$url .= $_SERVER['PATH_INFO'];

thereby doubling the $url string.



this is easily fixed by changing

if ($script_params)



to



if ($script_params && substr(php_sapi_name(), 0, 3) != 'cgi' )




















Saved Queries