summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-10-04 09:56:46 +0200
committerAleksander Machniak <alec@alec.pl>2014-10-04 09:59:22 +0200
commit0d6c67354682cba082b457618705dd2346ffa861 (patch)
treebfe924c7947f14adfee9d99ffb7ea3b5cf18cc2c /program/lib/Roundcube
parent34d179a69a8c64e1dca5bb96c11c7a90cbf3bd5a (diff)
Fix setting flags on servers with no PERMANENTFLAGS response (#1490087)
Conflicts: CHANGELOG
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 4809c8b11..2690cbd5a 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -2002,8 +2002,14 @@ class rcube_imap_generic
$flag = $this->flags[strtoupper($flag)];
}
- if (!$flag || (!in_array($flag, (array) $this->data['PERMANENTFLAGS'])
- && !in_array('\\*', (array) $this->data['PERMANENTFLAGS']))
+ if (!$flag) {
+ return false;
+ }
+
+ // if PERMANENTFLAGS is not specified all flags are allowed
+ if (!empty($this->data['PERMANENTFLAGS'])
+ && !in_array($flag, (array) $this->data['PERMANENTFLAGS'])
+ && !in_array('\\*', (array) $this->data['PERMANENTFLAGS'])
) {
return false;
}