Bug #9224: Don't output two slashes in a row
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 03:12:07 +0000 (21:12 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 03:12:07 +0000 (21:12 -0600)
framework/Core/lib/Horde.php

index 17c7cc3..5a0b4a2 100644 (file)
@@ -960,8 +960,8 @@ HTML;
         if (isset($puri['path']) && $puri['path'][0] == '/') {
             $url .= $puri['path'];
         } else {
-            $webroot = $GLOBALS['registry']->get('webroot', empty($opts['app']) ? null : $opts['app']);
-            $url .= '/' . ltrim($webroot, '/') . '/' . (isset($puri['path']) ? $puri['path'] : '');
+            $webroot = ltrim($GLOBALS['registry']->get('webroot', empty($opts['app']) ? null : $opts['app']), '/');
+            $url .= '/' . ($webroot ? $webroot . '/' : '') . (isset($puri['path']) ? $puri['path'] : '');
         }
 
         if (isset($puri['query'])) {