Skip to content

Commit

Permalink
Legislation now 404s on invalid file_id
Browse files Browse the repository at this point in the history
  • Loading branch information
inghamn committed Jan 31, 2022
1 parent 7ef34b2 commit 5fa5f5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Application/Controllers/LegislationFilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public function download(): View
{
if (!empty($_GET['legislationFile_id'])) {
try {
$file = new LegislationFile((int)$_GET['legislationFile_id']);
$id = (int)$_GET['legislationFile_id'];
if (!$id) { throw new \Exception('files/unknownFile'); }
$file = new LegislationFile($id);
$file->sendToBrowser();
}
catch (\Exception $e) {
Expand Down

0 comments on commit 5fa5f5f

Please sign in to comment.