public static function correctPath($path)
{
// remove trailing slash
if ($path != "/") {
$path = rtrim($path, "/ ");
}
// correct wrong path (root-node problem)
$path = str_replace("//", "/", $path);
if (strpos($path, "%") !== false) {
$path = rawurldecode($path);
}
return $path;
}