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/helpers/album.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/gallery/helpers') 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 @@ -39,6 +39,8 @@ class album_Core { ->error_messages("length", t("Your directory name is too long")) ->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")) @@ -75,6 +77,8 @@ class album_Core { $group->input("slug")->label(t("Internet Address"))->value($parent->slug) ->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")) -- cgit v1.2.3