Fixes for minor bugs pointed out by Tyler Akins.
[squirrelmail.git] / plugins / abook_take / setup.php
index 1130d9241e39649c81bca9203783eb5a4fa043c0..ed9e6e4d791d01d4061b7c5317e966d7141137e4 100755 (executable)
@@ -61,7 +61,7 @@ function abook_take_read_array($array)
   $i = 0;
   while ($i < count($array))
   {
-    abook_take_read_string($array[$i]);
+    abook_take_read_string($array[$i]->getAddress());
     $i ++;
   }
 }
@@ -83,10 +83,14 @@ function abook_take_read()
                   html_tag( 'tr' ) .
                       html_tag( 'td' );
 
-              abook_take_read_string($message->header->from);
-              abook_take_read_array($message->header->cc);
-              abook_take_read_array($message->header->reply_to);
-              abook_take_read_array($message->header->to);
+              if (isset($message->rfc822_header->from))
+                  abook_take_read_array($message->rfc822_header->from);
+              if (isset($message->rfc822_header->cc))
+                  abook_take_read_array($message->rfc822_header->cc);
+              if (isset($message->rfc822_header->reply_to))
+                  abook_take_read_array($message->rfc822_header->reply_to);
+              if (isset($message->rfc822_header->to))
+                  abook_take_read_array($message->rfc822_header->to);
 
 
               $new_body = $body;