Skip to content
Permalink
Browse files Browse the repository at this point in the history
#2074 - Mirror some additional file_proxy checks in data_rest.
--HG--
extra : source : 752417004a5c988b09f1312c4e96f10dd11594b9
  • Loading branch information
shadlaws committed Jun 12, 2013
1 parent c926ed2 commit cbbcf1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/gallery/helpers/data_rest.php
Expand Up @@ -25,7 +25,6 @@
class data_rest_Core {
static function get($request) {
$item = rest::resolve($request->url);
access::required("view", $item);

$p = $request->params;
if (!isset($p->size) || !in_array($p->size, array("thumb", "resize", "full"))) {
Expand All @@ -36,10 +35,16 @@ static function get($request) {
// see if you should make the same change there as well.

if ($p->size == "full") {
if ($item->is_album()) {
throw new Kohana_404_Exception();
}
access::required("view_full", $item);
$file = $item->file_path();
} else if ($p->size == "resize") {
access::required("view", $item);
$file = $item->resize_path();
} else {
access::required("view", $item);
$file = $item->thumb_path();
}

Expand Down

0 comments on commit cbbcf1b

Please sign in to comment.