6.0.0-RC7
6/27/26

[#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 1/5/07 (7113 days ago)
Due
Updated 1/6/07 (7112 days ago)
Assigned 1/5/07 (7113 days ago)
Resolved 1/6/07 (7112 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
572 Jan Schneider Comment #4
State ⇒ Duplicate
Reply to this comment
Duplicate of ticket #4151
18 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.




207 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
612 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