Browser correction in parent folder link

This commit is contained in:
bergware
2017-08-21 11:53:04 +02:00
parent fc59ae8d55
commit 87d78c8abb

View File

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