Fix string literals handling in IMAP STATUS (and various other) responses (#7290)

pull/7295/head
Aleksander Machniak 5 years ago
parent 7df358d64e
commit f9c84e2646

@ -26,6 +26,7 @@ CHANGELOG Roundcube Webmail
- Fix so button label in Select image/media dialogs is "Close" not "Cancel" (#7246) - Fix so button label in Select image/media dialogs is "Close" not "Cancel" (#7246)
- Fix regression in testing database schema on MSSQL (#7227) - Fix regression in testing database schema on MSSQL (#7227)
- Fix cursor position after inserting a group to a recipient input using autocompletion (#7267) - Fix cursor position after inserting a group to a recipient input using autocompletion (#7267)
- Fix string literals handling in IMAP STATUS (and various other) responses (#7290)
RELEASE 1.4.3 RELEASE 1.4.3
------------- -------------

@ -3725,7 +3725,21 @@ class rcube_imap_generic
$line = $this->readLine(4096); $line = $this->readLine(4096);
if ($response !== null) { if ($response !== null) {
// TODO: Better string literals handling with filter // In filter mode we need additional code for string literals.
// We'll merge the following literal data into one chunk, so
// it can be compared with the filter below
if ($filter && preg_match('/\{([0-9]+)\}\r\n$/', $line, $match)) {
// read and append the given bytes
$bytes = $match[1];
$out = '';
while (strlen($out) < $bytes) {
$tmp = $this->readBytes($bytes);
if ($tmp === null) break;
$out .= $tmp;
}
$line .= $out;
}
if (!$filter || preg_match($filter, $line)) { if (!$filter || preg_match($filter, $line)) {
$response .= $line; $response .= $line;
} }

Loading…
Cancel
Save