Skip to content

Commit

Permalink
Check page permissions when downloading attachments.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Sep 21, 2017
1 parent f3c28d8 commit 58197ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions wicked/lib/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,14 @@ public function download(Horde_Variables $vars)
{
global $wicked;

$page = $vars->get('page', 'Wiki/Home');
$pageName = $vars->get('page', 'Wiki/Home');
$page = Wicked_Page::getPage($pageName);
if (!$page->allows(Wicked::MODE_DISPLAY)) {
throw new Horde_Exception_PermissionDenied();
}

$page_id = (($id = $wicked->getPageId($page)) === false)
? $page
$page_id = (($id = $wicked->getPageId($pageName)) === false)
? $pageName
: $id;

$version = $vars->version;
Expand Down

0 comments on commit 58197ca

Please sign in to comment.