summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/album.php
diff options
context:
space:
mode:
authorshadlaws <shad@shadlaws.com>2013-03-12 12:14:34 +0100
committershadlaws <shad@shadlaws.com>2013-03-12 12:14:34 +0100
commited20798b99c0c6ab90e4d141ff74d7c2ca606ae7 (patch)
treeefd7b7ef1063afd6fcb8ffc458661e6cc52be995 /modules/gallery/helpers/album.php
parentcb8a63bb483742e86af9afd4e931b36638131317 (diff)
#2057 - Revise item name and slug validation - backslashes, refactor, error messages.
- disallowed backslashes in item validation. - refactored the validation logic in the item model a bit. - added no_backslash error messages in edit album/photo/movie forms. - fixed error messages in add album forum (some missing, some text different from edit) - added unit tests - updated to v58 to correct any existing backslashes in item names
Diffstat (limited to 'modules/gallery/helpers/album.php')
-rw-r--r--modules/gallery/helpers/album.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index 23aed8ac..fe6b03fc 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -34,12 +34,16 @@ class album_Core {
->error_messages("length", t("Your title is too long"));
$group->textarea("description")->label(t("Description"));
$group->input("name")->label(t("Directory name"))
- ->error_messages("no_slashes", t("The directory name can't contain the \"/\" character"))
+ ->error_messages("no_slashes", t("The directory name can't contain a \"/\""))
+ ->error_messages("no_backslashes", t("The directory name can't contain a \"\\\""))
+ ->error_messages("no_trailing_period", t("The directory name can't end in \".\""))
->error_messages("required", t("You must provide a directory name"))
->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(
+ "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",
@@ -64,13 +68,14 @@ class album_Core {
$group = $form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title)
- ->error_messages("required", t("You must provide a title"))
+ ->error_messages("required", t("You must provide a title"))
->error_messages("length", t("Your title is too long"));
$group->textarea("description")->label(t("Description"))->value($parent->description);
if ($parent->id != 1) {
$group->input("name")->label(t("Directory Name"))->value($parent->name)
->error_messages("conflict", t("There is already a movie, photo or album with this name"))
->error_messages("no_slashes", t("The directory name can't contain a \"/\""))
+ ->error_messages("no_backslashes", t("The directory name can't contain a \"\\\""))
->error_messages("no_trailing_period", t("The directory name can't end in \".\""))
->error_messages("required", t("You must provide a directory name"))
->error_messages("length", t("Your directory name is too long"));