From 05f7db7aa8499a597e44b5a0ea3bcf4d7e10bb57 Mon Sep 17 00:00:00 2001 From: jangliss Date: Sun, 10 Apr 2005 02:50:13 +0000 Subject: [PATCH] If From: field is unset in an email, header object for from field is not correctly set, and generates an error on reply (#1179754). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9234 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ src/compose.php | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0242861..a38166ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -308,6 +308,8 @@ Version 1.5.1 -- CVS - If default SquirrelMail language is set to empty string, interface will try to follow browser's HTTP_ACCEPT_LANGUAGE header or fallback to en_US (#764709). + - If From: field is unset in an email, header object for from field is not + correctly set, and generates an error on reply (#1179754). Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/src/compose.php b/src/compose.php index bc93c0d9..0e30edb8 100644 --- a/src/compose.php +++ b/src/compose.php @@ -170,7 +170,11 @@ function getReplyCitation($orig_from, $orig_date) { global $reply_citation_style, $reply_citation_start, $reply_citation_end; // FIXME: why object is rewritten with string. - $orig_from = decodeHeader($orig_from->getAddress(false),false,false,true); + if (!is_object($orig_from)) { + $orig_from = ''; + } else { + $orig_from = decodeHeader($orig_from->getAddress(false),false,false,true); + } // $from = decodeHeader($orig_header->getAddr_s('from',"\n$indent"),false,false); /* First, return an empty string when no citation style selected. */ @@ -1619,4 +1623,4 @@ function deliverMessage($composeMessage, $draft=false) { } // vim: et ts=4 -?> \ No newline at end of file +?> -- 2.25.1