From 3ad2b1b4b0ac0fc7a6c7a5adaad9a0616b890daf Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Thu, 24 Nov 2011 02:53:00 -0500 Subject: [PATCH] - Applied fixes from trunk up to r5479 --- program/include/main.inc | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/program/include/main.inc b/program/include/main.inc index c84e5ad..25940bd 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -730,12 +730,14 @@ /** * 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 @@ } // 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 -- Gitblit v1.9.1