fix
This commit is contained in:
parent
d1f030542a
commit
c81e9e8776
@ -27,6 +27,10 @@ abstract class Document {
|
||||
|
||||
public function getView() : ?View {
|
||||
|
||||
if ($this->activeView === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$view = parseClass($this->activeView);
|
||||
$file = getClassPath($view);
|
||||
if(!file_exists($file) || !is_subclass_of($view, View::class)) {
|
||||
|
@ -139,8 +139,8 @@ function serveStatic(string $webRoot, string $file): string {
|
||||
|
||||
$pathInfo = pathinfo($path);
|
||||
|
||||
// TODO: add more file extensions here
|
||||
$allowedExtension = array("html", "htm");
|
||||
// TODO: add more file extensions here, probably add them to settings?
|
||||
$allowedExtension = array("html", "htm", "pdf");
|
||||
$ext = $pathInfo["extension"] ?? "";
|
||||
if (!in_array($ext, $allowedExtension)) {
|
||||
http_response_code(406);
|
||||
|
Loading…
Reference in New Issue
Block a user