summaryrefslogtreecommitdiff
path: root/core/controllers/item.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-14 16:51:11 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-14 16:51:11 +0000
commite0ec9dd76a62ad712b2a771a383f262557116753 (patch)
treee9cbee80da6f8a2df2e2833e3b9d4f4000908aac /core/controllers/item.php
parent5a2fe6bb0b3068c47337e7382354f8ca340375e2 (diff)
Allow the HTTP get method to be called without an id to create any empty template.
Diffstat (limited to 'core/controllers/item.php')
-rw-r--r--core/controllers/item.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/controllers/item.php b/core/controllers/item.php
index 78ee7b0b..286eb66f 100644
--- a/core/controllers/item.php
+++ b/core/controllers/item.php
@@ -21,6 +21,10 @@ class Item_Controller extends REST_Controller {
protected $resource_type = "item";
public function _get($item) {
+ if (empty($item)) {
+ // A null item is not allowed for albums or photos.
+ return Kohana::show_404();
+ }
// Redirect to the more specific resource type, since it will render
// differently. We could also just delegate here, but it feels more appropriate
// to have a single canonical resource mapping.