From 0d5b29a28cbcf7b868f0712eb2629d4c77bfedf5 Mon Sep 17 00:00:00 2001 From: alec Date: Wed, 9 Feb 2011 12:01:29 +0000 Subject: - Add workaround for DBMail's bug http://www.dbmail.org/mantis/view.php?id=881 (#1487766) git-svn-id: https://svn.roundcube.net/trunk@4514 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/CHANGELOG | 1 + roundcubemail/program/include/rcube_imap_generic.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index ccc7b18a5..881779653 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Add workaround for DBMail's bug http://www.dbmail.org/mantis/view.php?id=881 (#1487766) - Use IMAP's ID extension (RFC2971) to print more info into debug log - Security: add optional referer check to prevent CSRF in GET requests - Fix email_dns_check setting not used for identities/contacts (#1487740) diff --git a/roundcubemail/program/include/rcube_imap_generic.php b/roundcubemail/program/include/rcube_imap_generic.php index dace4efd2..e7a9cedf3 100644 --- a/roundcubemail/program/include/rcube_imap_generic.php +++ b/roundcubemail/program/include/rcube_imap_generic.php @@ -3313,10 +3313,11 @@ class rcube_imap_generic else if ($string === '') { return '""'; } + // need quoted-string? find special chars: SP, CTL, (, ), {, %, *, ", \, ] + // plus [ character as a workaround for DBMail's bug (#1487766) else if ($force_quotes || - preg_match('/([\x00-\x20\x28-\x29\x7B\x25\x2A\x22\x5C\x5D\x7F]+)/', $string) + preg_match('/([\x00-\x20\x28-\x29\x7B\x25\x2A\x22\x5B\x5C\x5D\x7F]+)/', $string) ) { - // string: special chars: SP, CTL, (, ), {, %, *, ", \, ] return '"' . strtr($string, array('"'=>'\\"', '\\' => '\\\\')) . '"'; } -- cgit v1.2.3