From 07fa81dc4e718131319bba95cad88520b4b8224a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sat, 04 Oct 2014 03:56:46 -0400 Subject: [PATCH] Fix setting flags on servers with no PERMANENTFLAGS response (#1490087) --- program/lib/Roundcube/rcube_imap_generic.php | 10 ++++++++-- 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 9af5ce4..734a931 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -2041,8 +2041,14 @@ $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; } -- Gitblit v1.9.1