Browse Source

repo.php: parameter file: load raw file from repository

master
parent
commit
573e94f7a7
  1. 16
      repo.php

16
repo.php

@ -62,8 +62,20 @@ if ($branchId) {
if (array_key_exists('file', $_REQUEST)) {
$file = $repo->file_get_contents($_REQUEST['file']);
Header("Content-Type: text/plain; charset=utf/8");
print $file;
if ($file === false) {
Header("HTTP/1.1 403 Forbidden");
print "Access denied.";
}
else if ($file === null) {
Header("HTTP/1.1 404 File not found");
print "File not found.";
}
else {
Header("Content-Type: text/plain; charset=utf-8");
print $file;
}
exit(0);
}

Loading…
Cancel
Save