summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-02-05 17:43:54 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-02-05 17:43:54 +0000
commit96ecf8d61668aa551f7b8aa33b78f2abad2134ef (patch)
tree84ab2f03fda13625d5eaa7952bc59fcebabe478b /roundcubemail/program
parent5fb4dc99f4062b8296272ab10c2c7ed9a26f3e47 (diff)
- Support NGINX as IMAP backend: better BAD response handling (#1485720)
git-svn-id: https://svn.roundcube.net/trunk@2273 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/lib/imap.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/roundcubemail/program/lib/imap.inc b/roundcubemail/program/lib/imap.inc
index 7fd4aee26..302cfc007 100644
--- a/roundcubemail/program/lib/imap.inc
+++ b/roundcubemail/program/lib/imap.inc
@@ -68,7 +68,7 @@
- iil_C_HandlePartBody(): added 6th argument and fixed endless loop
- added iil_PutLineC()
- fixed iil_C_Sort() to support very long and/or divided responses
- - added BYE response simple support for endless loop prevention
+ - added BYE/BAD response simple support for endless loop prevention
- added 3rd argument in iil_StartsWith* functions
- fix iil_C_FetchPartHeader() in some cases by use of iil_C_HandlePartBody()
- allow iil_C_HandlePartBody() to fetch whole message
@@ -307,8 +307,8 @@ function iil_ParseResult($string) {
return -4;
}
-// check if $string starts with $match
-function iil_StartsWith($string, $match, $bye=false) {
+// check if $string starts with $match (or * BYE/BAD)
+function iil_StartsWith($string, $match, $error=false) {
$len = strlen($match);
if ($len == 0) {
return false;
@@ -316,7 +316,7 @@ function iil_StartsWith($string, $match, $bye=false) {
if (strncmp($string, $match, $len) == 0) {
return true;
}
- if ($bye && strncmp($string, '* BYE ', 6) == 0) {
+ if ($error && preg_match('/^\* (BYE|BAD) /', $string)) {
return true;
}
return false;