summaryrefslogtreecommitdiff
path: root/modules/gallery/models/item.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-05-15 15:53:38 -0700
committerBharat Mediratta <bharat@menalto.com>2012-05-15 15:53:38 -0700
commitaac18ef8339054e134fa3e52788a80e6907dfba5 (patch)
tree0cc2d836daa4c3de8ac383633be8b20603cae9cb /modules/gallery/models/item.php
parent3caf3cc323cd25b002aa8e44d871d4677da7a029 (diff)
Don't allow new albums with a slug that matches a controller - put up a
message telling the user that it's a reserved address. Partial fix for #95.
Diffstat (limited to 'modules/gallery/models/item.php')
-rw-r--r--modules/gallery/models/item.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 98a2c4df..992af0cc 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -833,6 +833,11 @@ class Item_Model_Core extends ORM_MPTT {
$v->add_error("name", "conflict");
return;
}
+
+ if ($this->parent_id == 1 && Kohana::auto_load("{$this->slug}_Controller")) {
+ $v->add_error("slug", "reserved");
+ return;
+ }
}
/**