summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-07-28 19:03:16 +0200
committerAleksander Machniak <alec@alec.pl>2014-07-28 19:03:55 +0200
commit057444bd415a3b0fef503f88f44d29b95e50d64d (patch)
tree628036ce2954252e6a143b55069607f903443a95
parent5d92a6540ae036141d42bb9ca54a4d637e424afe (diff)
Fix bug where $Forwarded flag was being set even if server didn't support it (#1490000)
-rw-r--r--CHANGELOG1
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php19
2 files changed, 15 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0047a4211..1623fa215 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ CHANGELOG Roundcube Webmail
- Enable contextmenu plugin for TinyMCE editor (#1487014)
- Fix some mime-type to extension mapping checks in Installer (#1489983)
- Fix errors when using localStorage in Safari's private browsing mode (#1489996)
+- Fix bug where $Forwarded flag was being set even if server didn't support it (#1490000)
RELEASE 1.0.2
-------------
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 709433041..f465ac13d 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -1964,10 +1964,6 @@ class rcube_imap_generic
*/
private function modFlag($mailbox, $messages, $flag, $mod = '+')
{
- if ($mod != '+' && $mod != '-') {
- $mod = '+';
- }
-
if (!$this->select($mailbox)) {
return false;
}
@@ -1977,12 +1973,25 @@ class rcube_imap_generic
return false;
}
+ if ($this->flags[strtoupper($flag)]) {
+ $flag = $this->flags[strtoupper($flag)];
+ }
+
+ if (!$flag || !in_array($flag, (array) $this->data['PERMANENTFLAGS'])
+ || !in_array('\\*', (array) $this->data['PERMANENTFLAGS'])
+ ) {
+ return false;
+ }
+
// Clear internal status cache
if ($flag == 'SEEN') {
unset($this->data['STATUS:'.$mailbox]['UNSEEN']);
}
- $flag = $this->flags[strtoupper($flag)];
+ if ($mod != '+' && $mod != '-') {
+ $mod = '+';
+ }
+
$result = $this->execute('UID STORE', array(
$this->compressMessageSet($messages), $mod . 'FLAGS.SILENT', "($flag)"),
self::COMMAND_NORESPONSE);