Skip to content

Commit

Permalink
check if Flags response is not array.
Browse files Browse the repository at this point in the history
Found that some responses return "false" instead
  • Loading branch information
jensstalder authored Sep 18, 2019
1 parent 78882f6 commit 2b7eb71
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Storage/Imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ public function getMessage($id)
$header = $data['RFC822.HEADER'];

$flags = [];
foreach ($data['FLAGS'] as $flag) {
$flags[] = isset(static::$knownFlags[$flag]) ? static::$knownFlags[$flag] : $flag;
}
if (is_array($data['FLAGS'])) { // MY FIX
foreach ($data['FLAGS'] as $flag) {
$flags[] = isset(static::$knownFlags[$flag]) ? static::$knownFlags[$flag] : $flag;
}
} // MY FIX

return new $this->messageClass(['handler' => $this, 'id' => $id, 'headers' => $header, 'flags' => $flags]);
}
Expand Down

0 comments on commit 2b7eb71

Please sign in to comment.