From 2646758314b09c46aecd028a45be4c6e5ca4251b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 02 Feb 2015 10:09:52 -0500
Subject: [PATCH] Fix handling of GETANNOTATION errors - return NULL on error as documented

---
 program/lib/Roundcube/rcube_imap.php |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index c45b6ea..6e5dcdb 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -3681,7 +3681,13 @@
 
             // @TODO: Honor MAXSIZE and DEPTH options
             foreach ($queries as $attrib => $entry) {
-                if ($result = $this->conn->getAnnotation($folder, $entry, $attrib)) {
+                $result = $this->conn->getAnnotation($folder, $entry, $attrib);
+
+                // an error, invalidate any previous getAnnotation() results
+                if (!is_array($result)) {
+                    return null;
+                }
+                else {
                     foreach ($result as $fldr => $data) {
                         $res[$fldr] = array_merge((array) $res[$fldr], $data);
                     }

--
Gitblit v1.9.1