If search string cannot be converted to ASCII (result is an empty string) use the original string (#1489911)

pull/194/head
Aleksander Machniak 11 years ago
parent 939380da27
commit 079be2c2fb

@ -1691,12 +1691,15 @@ class rcube_imap extends rcube_storage
$string_offset = $m[1] + strlen($m[0]) + 4; // {}\r\n
$string = substr($str, $string_offset - 1, $m[0]);
$string = rcube_charset::convert($string, $charset, $dest_charset);
if ($string === false) {
if ($string === false || !strlen($string)) {
continue;
}
$res .= substr($str, $last, $m[1] - $last - 1) . rcube_imap_generic::escape($string);
$last = $m[0] + $string_offset - 1;
}
if ($last < strlen($str)) {
$res .= substr($str, $last, strlen($str)-$last);
}

Loading…
Cancel
Save