Skip to content

Commit

Permalink
Mixed message header attribute in_reply_to "unified" #26
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Oct 16, 2020
1 parent 19affcc commit 624dc77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ protected function parse(){
if (property_exists($header, 'subject')) {
$this->attributes["subject"] = $this->decode($header->subject);
}
if (property_exists($header, 'in_reply_to')) {
$this->attributes["in_reply_to"] = is_array($header->in_reply_to) ? $header->in_reply_to : [$header->in_reply_to];
}
if (property_exists($header, 'references')) {
$this->attributes["references"] = $this->decode($header->references);
}
Expand Down Expand Up @@ -458,7 +461,7 @@ private function decodeAddresses($values) {
* @param object $header
*/
private function extractAddresses($header) {
foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender', 'in_reply_to'] as $key){
foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $key){
if (property_exists($header, $key)) {
$this->attributes[$key] = $this->parseAddresses($header->$key);
}
Expand Down

0 comments on commit 624dc77

Please sign in to comment.