From 38dc510b2dba02dba5a60fbc00947aac4fd24aab Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 29 Feb 2012 06:53:52 -0500
Subject: [PATCH] - Fix warning when properties array is empty

---
 program/include/rcube_imap_generic.php |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 4d4698f..2d636f0 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -7,7 +7,10 @@
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2005-2010, The Roundcube Dev Team                       |
  | Copyright (C) 2011, Kolab Systems AG                                  |
- | Licensed under the GNU GPL                                            |
+ |                                                                       |
+ | Licensed under the GNU General Public License version 3 or            |
+ | any later version with exceptions for skins & plugins.                |
+ | See the README file for a full license statement.                     |
  |                                                                       |
  | PURPOSE:                                                              |
  |   Provide alternative IMAP library that doesn't rely on the standard  |
@@ -1450,7 +1453,7 @@
 
         // Invoke SEARCH as a fallback
         $index = $this->search($mailbox, 'ALL UNSEEN', false, array('COUNT'));
-        if (!$index->isError()) {
+        if (!$index->is_error()) {
             return $index->count();
         }
 
@@ -1556,6 +1559,11 @@
             return new rcube_result_index($mailbox);
         }
 
+        // RFC 5957: SORT=DISPLAY
+        if (($field == 'FROM' || $field == 'TO') && $this->getCapability('SORT=DISPLAY')) {
+            $field = 'DISPLAY' . $field;
+        }
+
         // message IDs
         if (!empty($add))
             $add = $this->compressMessageSet($add);

--
Gitblit v1.9.1