summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap_generic.php
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:56:46 +0200
commit07fa81dc4e718131319bba95cad88520b4b8224a (patch)
tree529fe50945afba0f6bc80cfb286c785170f5042e /program/lib/Roundcube/rcube_imap_generic.php
parent063f5bdb77b47e6383f08204df352f2bb842e00b (diff)
Fix setting flags on servers with no PERMANENTFLAGS response (#1490087)
Diffstat (limited to 'program/lib/Roundcube/rcube_imap_generic.php')
-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 9af5ce4c6..734a9311e 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -2041,8 +2041,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;
}