You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
readResponse method in ImapProtocol class, parses token by 2 chars, but later checks for 2 & 3 chars.
I'm not sure how to fix this in accordance with the protocol
Code to Reproduce
See comments with // PROBLEM
publicfunctionreadResponse(Response$response, string$tag, bool$dontParse = false): array {
$lines = [];
$tokens = ""; // define $tokens variable before first usedo {
$readAll = $this->readLine($response, $tokens, $tag, $dontParse);
$lines[] = $tokens;
} while (!$readAll);
if ($dontParse) {
// First two chars are still needed for the response code$tokens = [substr($tokens, 0, 2)];
// PROBLEM this will always result in $tokens[0], having 2 chars
}
// last line has response codeif ($tokens[0] == 'OK') {
return$lines ?: [true];
// PROBLEM So this check for BAD or BYE will never happen
} elseif ($tokens[0] == 'NO' || $tokens[0] == 'BAD' || $tokens[0] == 'BYE') {
thrownewImapServerErrorException();
}
thrownewImapBadRequestException();
}
Expected behavior
Correct handling of error tokens.
Desktop / Server (please complete the following information):
Version 5.2.0
The text was updated successfully, but these errors were encountered:
Describe the bug
readResponse method in ImapProtocol class, parses token by 2 chars, but later checks for 2 & 3 chars.
I'm not sure how to fix this in accordance with the protocol
Code to Reproduce
See comments with // PROBLEM
Expected behavior
Correct handling of error tokens.
Desktop / Server (please complete the following information):
The text was updated successfully, but these errors were encountered: