Fix for from names displayed in the attachment area when the message is a
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 11 Feb 2006 11:13:05 +0000 (11:13 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 11 Feb 2006 11:13:05 +0000 (11:13 +0000)
digest. After opening a digest message the rfc822_header object structure
which resulted we couldn't few the from name anymore when switched back to
the digest message.
We need to fix this later. See the comments.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10703 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 6fb01e0133b3701dac6c80f64b8256560b5bf9d2..158d0bcf87b1a0077ad26169780f51862b56fb1f 100644 (file)
@@ -518,6 +518,13 @@ function formatAttachments($message, $exclude_id, $mailbox, $id) {
             $from_o = $rfc822_header->from;
             if (is_object($from_o)) {
                 $from_name = decodeHeader($from_o->getAddress(false));
+            } elseif (is_array($from_o) && count($from_o) && is_object($from_o[0])) {
+                // something weird happens when a digest message is opened and you return to the digest
+                // now the from object is part of an array. Probably the parseHeader call overwrites the info
+                // retrieved from the bodystructure in a different way. We need to fix this later.
+                // possible starting point, do not fetch header we already have and inspect how
+                // the rfc822_header object behaves.
+                $from_name = decodeHeader($from_o[0]->getAddress(false));
             } else {
                 $from_name = _("Unknown sender");
             }