summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js
diff options
context:
space:
mode:
authorroundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c>2005-11-02 22:43:55 +0000
committerroundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c>2005-11-02 22:43:55 +0000
commit57ec5d55c3e501a84b622be6f3b0d8a17e42214c (patch)
treed7923eba702f5b1eb17a71aec0a607ced8b8187e /roundcubemail/program/js
parent031e03812e6924ee21e0e1af57122fdef3d0772e (diff)
Added more XSS protection (Bug #1308236) and some visual enhancements
git-svn-id: https://svn.roundcube.net/trunk@73 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
-rw-r--r--roundcubemail/program/js/app.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index a61cc1e73..3f86e9f11 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -2046,18 +2046,17 @@ function rcube_webmail()
if (this.gui_objects.mailboxlist)
{
var item, reg, text_obj;
+ var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, '');
var s_mbox = String(mbox).toLowerCase().replace(this.mbox_expression, '');
var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, '');
- var nodes = this.gui_objects.mailboxlist.getElementsByTagName('LI');
- for (var n=0; n<nodes.length; n++)
- {
- item = nodes[n];
- if (item.className && item.className.indexOf('mailbox '+s_mbox+' ')>=0)
- this.set_classname(item, 'selected', true);
- else if (item.className && item.className.indexOf('mailbox '+s_current)>=0)
- this.set_classname(item, 'selected', false);
- }
+ var current_li = document.getElementById('rcmbx'+s_current);
+ var mbox_li = document.getElementById('rcmbx'+s_mbox);
+
+ if (current_li)
+ this.set_classname(current_li, 'selected', false);
+ if (mbox_li)
+ this.set_classname(mbox_li, 'selected', true);
}
this.env.mailbox = mbox;