diff options
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/helpers/album.php | 4 | ||||
-rw-r--r-- | modules/gallery/models/item.php | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php index 23d59eea..0945e4d9 100644 --- a/modules/gallery/helpers/album.php +++ b/modules/gallery/helpers/album.php @@ -40,6 +40,8 @@ class album_Core { ->error_messages("conflict", t("There is already a movie, photo or album with this name")); $group->input("slug")->label(t("Internet Address")) ->error_messages( + "reserved", t("This address is reserved and can't be used.")) + ->error_messages( "not_url_safe", t("The internet address should contain only letters, numbers, hyphens and underscores")) ->error_messages("required", t("You must provide an internet address")) @@ -76,6 +78,8 @@ class album_Core { ->error_messages( "conflict", t("There is already a movie, photo or album with this internet address")) ->error_messages( + "reserved", t("This address is reserved and can't be used.")) + ->error_messages( "not_url_safe", t("The internet address should contain only letters, numbers, hyphens and underscores")) ->error_messages("required", t("You must provide an internet address")) 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; + } } /** |