summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/data_rest.php20
1 files changed, 7 insertions, 13 deletions
diff --git a/modules/gallery/helpers/data_rest.php b/modules/gallery/helpers/data_rest.php
index 343975f6..abd4638e 100644
--- a/modules/gallery/helpers/data_rest.php
+++ b/modules/gallery/helpers/data_rest.php
@@ -32,27 +32,21 @@ class data_rest_Core {
throw new Rest_Exception("Bad Request", 400, array("errors" => array("size" => "invalid")));
}
- switch ($p->size) {
- case "thumb":
- $file = $item->thumb_path();
- break;
-
- case "resize":
- $file = $item->resize_path();
- break;
+ // Note: this code is roughly duplicated in file_proxy, so if you modify this, please look to
+ // see if you should make the same change there as well.
- case "full":
+ if ($p->size == "full") {
$file = $item->file_path();
- break;
+ } else if ($p->size == "resize") {
+ $file = $item->resize_path();
+ } else {
+ $file = $item->thumb_path();
}
if (!file_exists($file)) {
throw new Kohana_404_Exception();
}
- // Note: this code is roughly duplicated in data_rest, so if you modify this, please look to
- // see if you should make the same change there as well.
- //
// We don't have a cache buster in the url, so don't set cache headers here.
// We don't need to save the session for this request
Session::instance()->abort_save();