From e83456daa8a1a1c812ec50720c2e4cbe741f427f Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Nov 2010 11:38:58 +0000 Subject: [PATCH] * email: fix for Stylite Ticket#608: folders with umlauts (specialchars) did not display the count of unread mail --- felamimail/inc/class.ajaxfelamimail.inc.php | 53 +++++++++++---------- felamimail/inc/class.uiwidgets.inc.php | 10 ++-- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/felamimail/inc/class.ajaxfelamimail.inc.php b/felamimail/inc/class.ajaxfelamimail.inc.php index 127838c65d..e28303d033 100644 --- a/felamimail/inc/class.ajaxfelamimail.inc.php +++ b/felamimail/inc/class.ajaxfelamimail.inc.php @@ -1,21 +1,22 @@ + * @copyright (c) 2009-10 by Klaus Leithoff + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ - /* $Id$ */ - - class ajaxfelamimail { +/** + * a class containing / implementing the xajax actions triggered by javascript + */ +class ajaxfelamimail +{ // which profile to use(currently only 0 is supported) var $imapServerID=0; @@ -787,7 +788,7 @@ if ($this->_connectionStatus === true) { $folderName = $this->sessionData['mailbox']; - + //error_log(array2string($this->bofelamimail->getFolderStatus($folderName))); if ($folderStatus = $this->bofelamimail->getFolderStatus($folderName)) { if ($folderStatus['unseen'] > 0) { $response->addScript("egw_topWindow().tree.setItemText('$folderName', '". $folderStatus['shortDisplayName'] ." (". $folderStatus['unseen'] .")');"); @@ -809,30 +810,30 @@ $response = new xajaxResponse(); if(!($this->_connectionStatus === true)) $this->_connectionStatus = $this->bofelamimail->openConnection(); if($this->_connectionStatus === true) { - #error_log("connected"); + //error_log("connected"); if (is_array($activeFolders)) { foreach ($activeFolders as $key => $name) { - #error_log($key."=>".$name); + //error_log($key."=>".$name); switch($name) { case "0": break; case "--topfolder--": break; default: - $folders[$name] = $name; - #error_log("check folder $name"); + $folders[html_entity_decode($name,ENT_COMPAT)] = $name; + //error_log("check folder $name"); } } if (!(is_array($folders) && count($folders)>0)) $folders = $this->bofelamimail->getFolderObjects(true); } else { - #error_log("check/get all folders"); + //error_log("check/get all folders"); $folders = $this->bofelamimail->getFolderObjects(true); } foreach($folders as $folderName => $folderData) { - #error_log("checking $folderName"); + //error_log(__METHOD__.__LINE__."checking $folderName -> ".array2string($this->bofelamimail->getFolderStatus($folderName))); if($folderStatus = $this->bofelamimail->getFolderStatus($folderName)) { if($folderStatus['unseen'] > 0) { - $response->addScript("egw_topWindow().tree.setItemText('$folderName', '". $folderStatus['shortDisplayName'] ." (". $folderStatus['unseen'] .")');"); + $response->addScript("egw_topWindow().tree.setItemText('".@htmlspecialchars($folderName,ENT_QUOTES, bofelamimail::$displayCharset,false)."', '". $folderStatus['shortDisplayName'] ." (". $folderStatus['unseen'] .")');"); } else { - $response->addScript("egw_topWindow().tree.setItemText('$folderName', '". $folderStatus['shortDisplayName'] ."');"); + $response->addScript("egw_topWindow().tree.setItemText('".@htmlspecialchars($folderName,ENT_QUOTES, bofelamimail::$displayCharset,false)."', '". $folderStatus['shortDisplayName'] ."');"); } } } @@ -1280,5 +1281,5 @@ return str_replace($search, $replace, $folderName); } - } +} ?> diff --git a/felamimail/inc/class.uiwidgets.inc.php b/felamimail/inc/class.uiwidgets.inc.php index a934d0ea77..65c9da7734 100644 --- a/felamimail/inc/class.uiwidgets.inc.php +++ b/felamimail/inc/class.uiwidgets.inc.php @@ -15,8 +15,8 @@ /** * a class containing javascript enhanced html widgets */ - class uiwidgets - { +class uiwidgets +{ var $charset; var $bofelamimail; /** @@ -162,9 +162,9 @@ if($_useDisplayCharset == true) { $folderName = $GLOBALS['egw']->translation->convert($obj->folderName, 'UTF7-IMAP', $this->charset); - $folderName = @htmlspecialchars($folderName, ENT_QUOTES, $this->charset); + $folderName = @htmlspecialchars($folderName, ENT_QUOTES, $this->charset,false); } else { - $folderName = @htmlspecialchars($obj->folderName, ENT_QUOTES, $this->charset); + $folderName = @htmlspecialchars($obj->folderName, ENT_QUOTES, $this->charset,false); } // give INBOX a special foldericon if ($folderName == 'INBOX') { @@ -1067,5 +1067,5 @@ $this->t->parse('out','quota_block'); return $this->t->get('out','quota_block'); } - } +} ?>