From ee3e5941eb629a654a3f381c5777a89bea53030b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 4 Mar 2013 13:06:12 +0000 Subject: [PATCH] handle some array values (delimiter, attributes) when folderInfo was retrieved from cache --- felamimail/inc/class.felamimail_bo.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index 32518b396b..8b28e8b30f 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -1729,14 +1729,19 @@ class felamimail_bo // no folder info, but there is a status returned for the folder: something is wrong, try to cope with it $folderInfo = array(0 => (is_array($folderInfo)?$folderInfo:array('HIERACHY_DELIMITER'=>$this->getHierarchyDelimiter(), 'ATTRIBUTES' => ''))); + if (empty($folderInfo[0]['HIERACHY_DELIMITER']) || (isset($folderInfo[0]['delimiter']) && empty($folderInfo[0]['delimiter']))) + { + //error_log(__METHOD__.__LINE__.array2string($folderInfo)); + $folderInfo[0]['HIERACHY_DELIMITER'] = $this->getHierarchyDelimiter(); + } } } #if(!is_array($folderInfo[0])) { # return false; #} - $retValue['delimiter'] = $folderInfo[0]['HIERACHY_DELIMITER']; - $retValue['attributes'] = $folderInfo[0]['ATTRIBUTES']; + $retValue['delimiter'] = ($folderInfo[0]['HIERACHY_DELIMITER']?$folderInfo[0]['HIERACHY_DELIMITER']:$folderInfo[0]['delimiter']); + $retValue['attributes'] = ($folderInfo[0]['ATTRIBUTES']?$folderInfo[0]['ATTRIBUTES']:$folderInfo[0]['attributes']); $shortNameParts = explode($retValue['delimiter'], $_folderName); $retValue['shortName'] = array_pop($shortNameParts); $retValue['displayName'] = $this->encodeFolderName($_folderName);