$puri might not contain 'path', in fact it might not contain *any* keys if
$uri that is passed into the function is '#'
$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'])) {