summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-10-27 17:12:40 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-10-27 17:12:40 (GMT)
commitc1b59032bbcd3292121c94a6f64a528e47f2062f (patch)
treefcc7220880ad4bda8c887b9473623c473e2c95b8
parente9b3d92a3fd745916d3d656bf553f73eb23430d7 (diff)
downloadNet_IMAP4-c1b59032bbcd3292121c94a6f64a528e47f2062f.tar.gz
Force strings to wrap the annotations we query for in __list()HEADmaster
-rw-r--r--lib/Net/IMAP4.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Net/IMAP4.php b/lib/Net/IMAP4.php
index a4f9d36..567945a 100644
--- a/lib/Net/IMAP4.php
+++ b/lib/Net/IMAP4.php
@@ -3336,7 +3336,7 @@
$annotation = substr($annotation, strlen($prefix));
}
}
- $_arg[] = $this->_escape($annotation);
+ $_arg[] = $this->_escape($annotation, true);
}
$args[] = '(' . implode(' ', $_arg) . ')';
@@ -3365,7 +3365,7 @@
}
}
- $_arg[] = $this->_escape($annotation);
+ $_arg[] = $this->_escape($annotation, true);
}
$args[] = '(' . implode(' ', $_arg) . ')';
@@ -4057,13 +4057,20 @@
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)) {
- return $string;
+ if (!preg_match('/[\x00-\x20\x22\x28-\x2A\x5B-\x5D\x7B\x7D\x80-\xFF]/', $string)) {
+ if (!$force_quotes) {
+ return $string;
+ } else {
+ return '"' . $string . '"';
+ }
}
+
// quoted-string
if (!preg_match('/[\r\n\x00\x80-\xFF]/', $string)) {
return '"' . addcslashes($string, '\\"') . '"';