Avoid adding redundant slashes when building selfUrl.
authorMichael Rubinsky <mrubinsk@simon.horde.org>
Sun, 15 Aug 2010 15:27:06 +0000 (15:27 +0000)
committerMichael Rubinsky <mrubinsk@simon.horde.org>
Sun, 15 Aug 2010 15:28:48 +0000 (15:28 +0000)
This fixes broken url parameters when using pretty urls. For example,
the url parameter to the login link.

framework/Core/lib/Horde.php

index bed85ee..c4f782e 100644 (file)
@@ -1285,7 +1285,7 @@ HTML;
 
         if ($script_params) {
             if ($pathInfo = Horde_Util::getPathInfo()) {
-                $url .= '/' . $pathInfo;
+                $url .= (strrpos($url, '/') !== (strlen($url) - 1) ?  '/' : '')  . $pathInfo;
             }
             if (!empty($_SERVER['QUERY_STRING'])) {
                 $url .= '?' . $_SERVER['QUERY_STRING'];