From e8fc8d303a30658abd70419917a1373131802e28 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 02 Feb 2015 10:08:18 -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 a1fd874..d17b33f 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -3951,7 +3951,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