Skip to content

Commit

Permalink
[HIGH] Unpublished items or items in unpublished releases or categori…
Browse files Browse the repository at this point in the history
…es could be downloaded
  • Loading branch information
Nicholas K. Dionysopoulos committed Apr 9, 2019
1 parent bf10a40 commit c9649fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

**Bug fixes**

* [HIGH] Unpublished items or items in unpublished releases or categories could be downloaded
* [MEDIUM] Releases: filter by Maturity was broken for the "Beta" option
* [LOW] Unused common tables folder

Expand Down
15 changes: 15 additions & 0 deletions component/frontend/Controller/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,21 @@ public function download()
{
throw new \Exception('Filtering failed');
}

if (!$item->published)
{
throw new \Exception('Item unpublished');
}

if (!$item->release->published)
{
throw new \Exception('Release unpublished');
}

if (!$item->release->category->published)
{
throw new \Exception('Category unpublished');
}
}
catch (\Exception $e)
{
Expand Down

0 comments on commit c9649fb

Please sign in to comment.