diff --git a/src/Imap.php b/src/Imap.php index 2449bb2..fdfa43a 100644 --- a/src/Imap.php +++ b/src/Imap.php @@ -1093,7 +1093,7 @@ private function getEmailResponse($command, $parameters = array(), $first = fals //if there is email data if (!empty($email)) { //create the email format and add it to emails - $emails[$uniqueId] = $this->getEmailFormat($email, $uniqueId, $flags); + $emails[$uniqueId] = $this->getEmailFormat($email, $uniqueId, isset($flags) && is_array($flags) ? $flags : []); //if all we want is the first one if ($first) { @@ -1160,7 +1160,7 @@ private function getEmailResponse($command, $parameters = array(), $first = fals //if there is email data if (!empty($email)) { //create the email format and add it to emails - $emails[$uniqueId] = $this->getEmailFormat($email, $uniqueId, $flags); + $emails[$uniqueId] = $this->getEmailFormat($email, $uniqueId, isset($flags) && is_array($flags) ? $flags : []); //if all we want is the first one if ($first) {