Skip to content

Commit

Permalink
Convert sender name from non-utf8 to uf8 #260 (@hwilok) #259
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Nov 29, 2019
1 parent 83a8e9a commit 5d1c3e6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/IMAP/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,15 @@ private function parseAddresses($list) {
}
if (!property_exists($address, 'personal')) {
$address->personal = false;
}

$personalParts = imap_mime_header_decode($address->personal);
} else {
$personalParts = imap_mime_header_decode($address->personal);

$address->personal = '';
foreach ($personalParts as $p) {
$address->personal .= $p->text;
if(is_array($personalParts)) {
$address->personal = '';
foreach ($personalParts as $p) {
$address->personal .= $p->text;
}
}
}

$address->mail = ($address->mailbox && $address->host) ? $address->mailbox.'@'.$address->host : false;
Expand Down

0 comments on commit 5d1c3e6

Please sign in to comment.