diff --git a/asset.php b/asset.php index 76bd2c1e..e47d6dcd 100644 --- a/asset.php +++ b/asset.php @@ -15,10 +15,6 @@ if (!array_key_exists($repoId, $allRepositories)) { $repoData = $allRepositories[$repoId]; $repo = getRepo($repoId, $repoData); -if (!array_key_exists('dir', $_REQUEST)) { - $_REQUEST['dir'] = '.'; -} - if (array_key_exists('list', $_REQUEST)) { $contents = array(); foreach ($repo->scandir($_REQUEST['dir']) as $f) { @@ -32,7 +28,7 @@ if (array_key_exists('list', $_REQUEST)) { } else { $tmpfile = tempnam('/tmp', 'osb-asset-'); - $contents = $repo->file_get_contents("{$_REQUEST['dir']}/{$_REQUEST['file']}"); + $contents = $repo->file_get_contents((array_key_exists('dir', $_REQUEST) ? "{$_REQUEST['dir']}/" : '') . $_REQUEST['file']); if ($contents === false) { Header("HTTP/1.1 401 Permission denied");