From c093dcc391ad886ab815e6e70630c8e252df06ab Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 12 Sep 2012 03:57:28 -0400
Subject: [PATCH] Fix is_error() returns wrong result for empty result set
---
program/include/rcube_result_index.php | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/program/include/rcube_result_index.php b/program/include/rcube_result_index.php
index cc1615d..334ec85 100644
--- a/program/include/rcube_result_index.php
+++ b/program/include/rcube_result_index.php
@@ -61,10 +61,14 @@
for ($i=0, $len=count($data); $i<$len; $i++) {
$data_item = &$data[$i];
if (preg_match('/^ SORT/i', $data_item)) {
+ // valid response, initialize raw_data for is_error()
+ $this->raw_data = '';
$data_item = substr($data_item, 5);
break;
}
else if (preg_match('/^ (E?SEARCH)/i', $data_item, $m)) {
+ // valid response, initialize raw_data for is_error()
+ $this->raw_data = '';
$data_item = substr($data_item, strlen($m[0]));
if (strtoupper($m[1]) == 'ESEARCH') {
--
Gitblit v1.9.1