Initializing aHeaderFields to avoid notices
[squirrelmail.git] / functions / mailbox_display.php
index 9f7b277a528a2d2327c69ae8bc435646ac1c114c..1ffe727c35c238d3663712f545e998dd761439bf 100644 (file)
@@ -302,6 +302,7 @@ function fetchMessageHeaders($imapConnection, &$aMailbox) {
     $iError = 0;
     $aFetchItems = $aHeaderItems = array();
     // initialize the fields we want to retrieve:
+    $aHeaderFields = array();
     foreach ($aFetchHeaders as $v) {
       switch ($v) {
         case SQM_COL_DATE:       $aHeaderFields[] = 'Date';         break;
@@ -600,6 +601,8 @@ function prepareMessageList(&$aMailbox, $aProps) {
                                          'answered'=>false,
                                          'flagged' => false,
                                          'draft' => false);
+                                         
+                    if(!is_array($value)) $value = array();                     
                     foreach ($value as $sFlag => $value) {
                         switch ($sFlag) {
                           case '\\seen'    : $aFlagColumn['seen']     = true; break;