From 0ccef59cfa1bf4b87fe616d94abab59f10d6717a Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 08 Apr 2014 02:53:43 -0400
Subject: [PATCH] Fix bug where "With attachment" option in search filter wasn't selected after return from mail view (#1489774)

---
 CHANGELOG                   |    1 +
 program/steps/mail/func.inc |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 75e2b69..43cf899 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,7 @@
 - Set In-Reply-To and References for forwarded messages (#1489593)
 - Removed redundant default_folders config option (#1489737)
 - Implemented IMAP SPECIAL-USE extension support [RFC6154] (#1487830)
+- Fix bug where "With attachment" option in search filter wasn't selected after return from mail view (#1489774)
 
 RELEASE 1.0.0
 -------------
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 7adc065..58f529f 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -2036,7 +2036,7 @@
     $ctypes = array('application/', 'multipart/m', 'multipart/signed', 'multipart/report');
 
     // Build search string of "with attachment" filter
-    $attachment = str_repeat(' OR', count($ctypes)-1);
+    $attachment = trim(str_repeat(' OR', count($ctypes)-1));
     foreach ($ctypes as $type) {
         $attachment .= ' HEADER Content-Type ' . rcube_imap_generic::escape($type);
     }

--
Gitblit v1.9.1