From aac18ef8339054e134fa3e52788a80e6907dfba5 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 15 May 2012 15:53:38 -0700 Subject: 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. --- modules/gallery/models/item.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gallery/models') 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; + } } /** -- cgit v1.2.3