From 57ec5d55c3e501a84b622be6f3b0d8a17e42214c Mon Sep 17 00:00:00 2001 From: roundcube Date: Wed, 2 Nov 2005 22:43:55 +0000 Subject: Added more XSS protection (Bug #1308236) and some visual enhancements git-svn-id: https://svn.roundcube.net/trunk@73 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/app.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'roundcubemail/program/js') 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=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; -- cgit v1.2.3