summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/include/main.inc8
-rw-r--r--program/js/app.js3
2 files changed, 5 insertions, 6 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index dbed2ba09..c870b495d 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -590,12 +590,12 @@ function get_input_value($fname, $source, $allow_html=FALSE, $charset=NULL)
/**
* Remove all non-ascii and non-word chars
- * except . and -
+ * except ., -, _
*/
-function asciiwords($str, $css_id = false)
+function asciiwords($str, $css_id = false, $replace_with = '')
{
$allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : '');
- return preg_replace("/[^$allowed]/i", '', $str);
+ return preg_replace("/[^$allowed]/i", $replace_with, $str);
}
/**
@@ -1201,7 +1201,7 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, &$jslist, $at
}
// make folder name safe for ids and class names
- $folder_id = asciiwords($folder['id'], true);
+ $folder_id = asciiwords($folder['id'], true, '_');
$classes = array('mailbox');
// set special class for Sent, Drafts, Trash and Junk
diff --git a/program/js/app.js b/program/js/app.js
index 0933ca631..2831e3d8d 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3496,7 +3496,6 @@ function rcube_webmail()
if ((current_li = this.get_folder_li(old))) {
$(current_li).removeClass('selected').removeClass('unfocused');
}
-
if ((target_li = this.get_folder_li(name))) {
$(target_li).removeClass('unfocused').addClass('selected');
}
@@ -3511,7 +3510,7 @@ function rcube_webmail()
{
if (this.gui_objects.folderlist)
{
- name = String(name).replace(this.identifier_expr, '');
+ name = String(name).replace(this.identifier_expr, '_');
return document.getElementById('rcmli'+name);
}