Skip to content

Commit

Permalink
Return a 404 if api/file/sequence called directly with no file
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Dec 24, 2024
1 parent 502ffc3 commit 99b25c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/api/controllers/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ function GetFileImpl($dir, $filename, $lines, $play, $attach)
$filename = substr($filename, 8);
}

if (!file_exists($dir . '/' . $filename)) {
if (!file_exists($dir . '/' . $filename) || !is_file($dir . '/' . $filename)) {
http_response_code(404);
echo "File $dir/$filename does not exist.";
return;
}
Expand Down

0 comments on commit 99b25c3

Please sign in to comment.