Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty body #233

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Connection/Protocols/ImapProtocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ public function fetch($items, $from, $to = null, $uid = IMAP::ST_UID) {
if ($to === null && !is_array($from) && ($uid ? $tokens[2][$uidKey] != $from : $tokens[0] != $from)) {
continue;
}
$data = "";

// if we only want one item we return that one directly
if (count($items) == 1) {
Expand All @@ -594,6 +593,7 @@ public function fetch($items, $from, $to = null, $uid = IMAP::ST_UID) {
} elseif ($uid && $tokens[2][2] == $items[0]) {
$data = $tokens[2][3];
} else {
$expectedResponse = 0;
// maybe the server send an other field we didn't wanted
$count = count($tokens[2]);
// we start with 2, because 0 was already checked
Expand All @@ -602,8 +602,12 @@ public function fetch($items, $from, $to = null, $uid = IMAP::ST_UID) {
continue;
}
$data = $tokens[2][$i + 1];
$expectedResponse = 1;
break;
}
if (!$expectedResponse) {
continue;
}
}
} else {
$data = [];
Expand Down