|
|
@ -3616,13 +3616,16 @@ class rcube_imap_generic
|
|
|
|
if ($string === null) {
|
|
|
|
if ($string === null) {
|
|
|
|
return 'NIL';
|
|
|
|
return 'NIL';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($string === '') {
|
|
|
|
if ($string === '') {
|
|
|
|
return '""';
|
|
|
|
return '""';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// atom-string (only safe characters)
|
|
|
|
// 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;
|
|
|
|
return $string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// quoted-string
|
|
|
|
// quoted-string
|
|
|
|
if (!preg_match('/[\r\n\x00\x80-\xFF]/', $string)) {
|
|
|
|
if (!preg_match('/[\r\n\x00\x80-\xFF]/', $string)) {
|
|
|
|
return '"' . addcslashes($string, '\\"') . '"';
|
|
|
|
return '"' . addcslashes($string, '\\"') . '"';
|
|
|
|