summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-05-30 11:52:15 +0000
committeralecpl <alec@alec.pl>2008-05-30 11:52:15 +0000
commit6eaac22d3244763800f4ce8e60bfb5c67f46b710 (patch)
treedd29d5b45567b5d3f960b50e879695be95e5afb9 /program/js
parentea400ed2df4b7ce6033be58c5e0ce49608ea2c99 (diff)
- Disallowed delimiter in folder name (#1484803)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/program/js/app.js b/program/js/app.js
index bebf561a7..5f8d125f6 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2647,12 +2647,20 @@ function rcube_webmail()
var form;
if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
+ {
name = form.elements['_folder_name'].value;
- if (this.env.folder && name != '')
- name = this.env.folder+this.env.delimiter+name;
- if (name)
+ if (name.indexOf(this.env.delimiter)>=0)
+ {
+ alert(this.get_label('forbiddencharacter'));
+ return false;
+ }
+
+ if (this.env.folder && name != '')
+ name = this.env.folder+this.env.delimiter+name;
+
this.http_post('create-folder', '_name='+urlencode(name), true);
+ }
else if (form.elements['_folder_name'])
form.elements['_folder_name'].focus();
};
@@ -2716,8 +2724,15 @@ function rcube_webmail()
var newname = this.name_input ? this.name_input.value : null;
if (this.edit_folder && newname)
{
+ if (newname.indexOf(this.env.delimiter)>=0)
+ {
+ alert(this.get_label('forbiddencharacter'));
+ return false;
+ }
+
if (this.name_input.__parent)
newname = this.name_input.__parent + this.env.delimiter + newname;
+
this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname));
}
}