From a588e50392c154f497b5dcf314d7c43d19d0eb44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 25 Feb 2019 22:07:17 +0100 Subject: [PATCH] asset.php: bugfix, compatibility RepositoryGit --- asset.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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");