|
|
@ -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"); |
|
|
|