Skip to content

Commit

Permalink
Fix empty HTML body exception
Browse files Browse the repository at this point in the history
Before the data was erased now it's not.
Based on Webklex#233
  • Loading branch information
boekkooi-lengoo committed Jul 7, 2022
1 parent ee4fb5f commit 2ae8a40
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Connection/Protocols/ImapProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,16 +596,21 @@ public function fetch($items, $from, $to = null, $uid = IMAP::ST_UID) {
} elseif ($uid && $tokens[2][2] == $items[0]) {
$data = $tokens[2][3];
} else {
// maybe the server send an other field we didn't wanted
$expectedResponse = false;
// maybe the server send another field we didn't want
$count = is_countable($tokens[2]) ? count($tokens[2]) : 0;
// we start with 2, because 0 was already checked
for ($i = 2; $i < $count; $i += 2) {
if ($tokens[2][$i] != $items[0]) {
continue;
}
$data = $tokens[2][$i + 1];
$expectedResponse = true;
break;
}
if (!$expectedResponse) {
continue;
}
}
} else {
$data = [];
Expand Down

0 comments on commit 2ae8a40

Please sign in to comment.