From fb6d86b9ad851ee72e79b5031fcaace71dfbe997 Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 23 Nov 2011 18:05:38 +0000 Subject: - Fixed bug where similiar folder names were highlighted wrong (#1487860) --- program/include/main.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'program/include') diff --git a/program/include/main.inc b/program/include/main.inc index 1868f42d2..002501804 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -730,12 +730,14 @@ function asciiwords($str, $css_id = false, $replace_with = '') /** * Convert the given string into a valid HTML identifier - * Same functionality as done in app.js with this.identifier_expr - * + * Same functionality as done in app.js with rcube_webmail.html_identifier() */ -function html_identifier($str) +function html_identifier($str, $encode=false) { - return asciiwords($str, true, '_'); + if ($encode) + return rtrim(strtr(base64_encode($str), '+/', '-_'), '='); + else + return asciiwords($str, true, '_'); } /** @@ -1331,7 +1333,7 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, &$jslist, $at } // make folder name safe for ids and class names - $folder_id = html_identifier($folder['id']); + $folder_id = html_identifier($folder['id'], true); $classes = array('mailbox'); // set special class for Sent, Drafts, Trash and Junk -- cgit v1.2.3