summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-03-06 19:42:23 +0000
committeralecpl <alec@alec.pl>2012-03-06 19:42:23 +0000
commit8b3c68d42d4ee142449f9249590b45658b93cd26 (patch)
treeda837c83de9b8cbe462c8049fa449fecca9746b5 /program
parent4da69b953e7a3b6f83be2406bb2f0b8196d63c08 (diff)
- Fix handling of % character in IMAP protocol (#1488382)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap_generic.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index cffb250fb..f286ec6bd 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -3616,13 +3616,16 @@ class rcube_imap_generic
if ($string === null) {
return 'NIL';
}
+
if ($string === '') {
return '""';
}
+
// atom-string (only safe characters)
- if (!$force_quotes && !preg_match('/[\x00-\x20\x22\x28-\x2A\x5B-\x5D\x7B\x7D\x80-\xFF]/', $string)) {
+ if (!$force_quotes && !preg_match('/[\x00-\x20\x22\x25\x28-\x2A\x5B-\x5D\x7B\x7D\x80-\xFF]/', $string)) {
return $string;
}
+
// quoted-string
if (!preg_match('/[\r\n\x00\x80-\xFF]/', $string)) {
return '"' . addcslashes($string, '\\"') . '"';