Ensure 'path' exists before accessing it.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 5 Sep 2010 02:31:49 +0000 (22:31 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 5 Sep 2010 02:31:49 +0000 (22:31 -0400)
$puri might not contain 'path', in fact it might not contain *any* keys if
$uri that is passed into the function is '#'

framework/Core/lib/Horde.php

index b5d02d3..2c69ade 100644 (file)
@@ -954,11 +954,11 @@ HTML;
             $url = $protocol . '://' . $server_name;
         }
 
-        if ($puri['path'][0] == '/') {
+        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, '/') . '/' . $puri['path'];
+            $url .= '/' . ltrim($webroot, '/') . '/' . (isset($puri['path']) ? $puri['path'] : '');
         }
 
         if (isset($puri['query'])) {