From a08b4131939dccd35ac599ece906af8a1cb08633 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 18 Jun 2018 18:45:37 +0200 Subject: [PATCH] Get the correct parts of email addresses Fixes #17 --- application/inc/Models/Email.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/inc/Models/Email.php b/application/inc/Models/Email.php index 9cac80ce..d7b7579e 100644 --- a/application/inc/Models/Email.php +++ b/application/inc/Models/Email.php @@ -245,12 +245,12 @@ public function getRecipientAddress(): string public static function mapFromDB(array $data): array { $data['from'] = explode('<', $data['from']); - $senderName = trim($data['from'][0]); - $senderAddress = mb_substr($data['from'][1], 0, -1); + $senderAddress = trim($data['from'][0]); + $senderName = mb_substr($data['from'][1], 0, -1); $data['to'] = explode('<', $data['to']); - $recipientName = trim($data['to'][0]); - $recipientAddress = mb_substr($data['to'][1], 0, -1); + $recipientAddress = trim($data['to'][0]); + $recipientName = mb_substr($data['to'][1], 0, -1); return [ 'id' => $data['id'],