Fix for deleting message from search expiring cache.
[squirrelmail.git] / class / mime / Rfc822Header.class.php
index 8801bd84c2721d052dc7923c016c8acb4aa1a013..5f7b21b7f1c4799a0e79e80a017ef20b274a8818 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This file contains functions needed to handle headers in mime messages.
  *
- * @copyright © 2003-2007 The SquirrelMail Project Team
+ * @copyright © 2003-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -509,7 +509,7 @@ class Rfc822Header {
             $sComment = trim(implode(' ',$aComment));
             $sPersonal .= $sComment;
         }
-        $oAddr =& new AddressStructure();
+        $oAddr = new AddressStructure();
         if ($sPersonal && substr($sPersonal,0,2) == '=?') {
             $oAddr->personal = encodeHeader($sPersonal);
         } else {
@@ -609,7 +609,7 @@ class Rfc822Header {
                          $iPosAt = strpos($aAddr['email'], '@');
                          if ($iPosAt === FALSE) {
                              $oAddr->mailbox = $aAddr['email'];
-                             $oAddr->host = '';
+                             $oAddr->host = FALSE;
                          } else {
                              $oAddr->mailbox = substr($aAddr['email'], 0, $iPosAt);
                              $oAddr->host = substr($aAddr['email'], $iPosAt+1);
@@ -642,7 +642,10 @@ class Rfc822Header {
         if ($ar) {
             return $aProcessedAddress;
         } else {
-            return $aProcessedAddress[0];
+            if (isset($aProcessedAddress[0]))
+                return $aProcessedAddress[0];
+            else
+                return '';
         }
     }