Browser handle corner case when no dir is given

This commit is contained in:
bergware
2017-08-21 11:30:16 +02:00
parent dcbdc0c9b2
commit fc59ae8d55

View File

@@ -16,7 +16,7 @@ require_once "$docroot/webGui/include/Helpers.php";
function parent_link() {
global $dir,$path;
if ($dir=='/' || dirname($dir)=='/mnt' || dirname($dir)=='/mnt/user') return "";
if (!$dir || $dir=='/' || dirname($dir)=='/mnt' || dirname($dir)=='/mnt/user') return "";
$parent = urlencode_path(dirname($dir));
return "<a href=\"".htmlspecialchars("/$path?dir=$parent")."\">Parent Directory...</a>";
}