summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap_generic.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/lib/Roundcube/rcube_imap_generic.php')
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index db50ffbab..6c1b85552 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -746,7 +746,7 @@ class rcube_imap_generic
}
if ($this->prefs['timeout'] <= 0) {
- $this->prefs['timeout'] = ini_get('default_socket_timeout');
+ $this->prefs['timeout'] = max(0, intval(ini_get('default_socket_timeout')));
}
// Connect
@@ -1077,7 +1077,7 @@ class rcube_imap_generic
}
if (!$this->data['READ-WRITE']) {
- $this->setError(self::ERROR_READONLY, "Mailbox is read-only", 'EXPUNGE');
+ $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
return false;
}
@@ -1652,7 +1652,6 @@ class rcube_imap_generic
}
if (!empty($criteria)) {
- $modseq = stripos($criteria, 'MODSEQ') !== false;
$params .= ($params ? ' ' : '') . $criteria;
}
else {
@@ -1791,7 +1790,6 @@ class rcube_imap_generic
if ($skip_deleted && preg_match('/FLAGS \(([^)]+)\)/', $line, $matches)) {
$flags = explode(' ', strtoupper($matches[1]));
if (in_array('\\DELETED', $flags)) {
- $deleted[$id] = $id;
continue;
}
}
@@ -1936,7 +1934,7 @@ class rcube_imap_generic
}
if (!$this->data['READ-WRITE']) {
- $this->setError(self::ERROR_READONLY, "Mailbox is read-only", 'STORE');
+ $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
return false;
}
@@ -1997,7 +1995,7 @@ class rcube_imap_generic
}
if (!$this->data['READ-WRITE']) {
- $this->setError(self::ERROR_READONLY, "Mailbox is read-only", 'STORE');
+ $this->setError(self::ERROR_READONLY, "Mailbox is read-only");
return false;
}
@@ -2172,7 +2170,7 @@ class rcube_imap_generic
// create array with header field:data
if (!empty($headers)) {
$headers = explode("\n", trim($headers));
- foreach ($headers as $hid => $resln) {
+ foreach ($headers as $resln) {
if (ord($resln[0]) <= 32) {
$lines[$ln] .= (empty($lines[$ln]) ? '' : "\n") . trim($resln);
} else {
@@ -2180,7 +2178,7 @@ class rcube_imap_generic
}
}
- while (list($lines_key, $str) = each($lines)) {
+ foreach ($lines as $str) {
list($field, $string) = explode(':', $str, 2);
$field = strtolower($field);
@@ -2508,7 +2506,7 @@ class rcube_imap_generic
$tokens = $this->tokenizeResponse(preg_replace('/(^\(|\)$)/', '', $line));
for ($i=0; $i<count($tokens); $i+=2) {
- if (preg_match('/^(BODY|BINARY)/i', $token)) {
+ if (preg_match('/^(BODY|BINARY)/i', $tokens[$i])) {
$result = $tokens[$i+1];
$found = true;
break;
@@ -3540,7 +3538,7 @@ class rcube_imap_generic
if (is_array($element)) {
reset($element);
- while (list($key, $value) = each($element)) {
+ foreach ($element as $value) {
$string .= ' ' . self::r_implode($value);
}
}