summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-06-11 15:15:28 +0000
committeralecpl <alec@alec.pl>2009-06-11 15:15:28 +0000
commit8ca0c7ce6a1c7f8eb60cddc5955db51afd2cd107 (patch)
treeab88854d61aaf26208df5a1d13d727b0a1b7eb92 /program/include
parent59c027ba5fa1042ffd0f62bec97a8127002f2b79 (diff)
- fix folder ID generation (for example two folders 'aaa' and 'aaa "')
Diffstat (limited to 'program/include')
-rw-r--r--program/include/main.inc8
1 files changed, 4 insertions, 4 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