summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-05-22 12:34:33 +0200
committerAleksander Machniak <alec@alec.pl>2014-05-22 12:34:33 +0200
commit079be2c2fbdc9decbbf5bd123c3800ba001423b1 (patch)
tree554abfb8772828756d383fef7cce2e0db9ca17b0 /program
parent939380da27f3502847fc1f18e8b67f3fb6d6742f (diff)
If search string cannot be converted to ASCII (result is an empty string) use the original string (#1489911)
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube_imap.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 4b32c466b..bf588cacf 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -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);
}