summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-03-13 22:53:26 +0000
committerthomascube <thomas@roundcube.net>2007-03-13 22:53:26 +0000
commite6c7c3ca9381aa10f7147544cd93f6179d32f359 (patch)
treeea25a1d2310ea7e5e367780deeaee960526a7b96
parent6ce04b1f7f15e8f8e79641787650a354f99b28de (diff)
Fixed bugs in rcube_db and rcube_imap classes
-rwxr-xr-xprogram/include/rcube_db.inc14
-rw-r--r--program/include/rcube_imap.inc3
2 files changed, 10 insertions, 7 deletions
diff --git a/program/include/rcube_db.inc b/program/include/rcube_db.inc
index a01b38dd6..f17605a74 100755
--- a/program/include/rcube_db.inc
+++ b/program/include/rcube_db.inc
@@ -293,14 +293,16 @@ class rcube_db
{
case 'pgsql':
$result = &$this->db_handle->getOne("SELECT CURRVAL('$sequence')");
-
- case 'mssql':
- $result = &$this->db_handle->getOne("SELECT @@IDENTITY");
-
if (DB::isError($result))
raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
'message' => $result->getMessage()), TRUE, FALSE);
+ return $result;
+ case 'mssql':
+ $result = &$this->db_handle->getOne("SELECT @@IDENTITY");
+ if (DB::isError($result))
+ raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
+ 'message' => $result->getMessage()), TRUE, FALSE);
return $result;
case 'mysql': // This is unfortuneate
@@ -308,7 +310,7 @@ class rcube_db
case 'mysqli':
return mysqli_insert_id($this->db_handle->connection);
-
+
case 'sqlite':
return sqlite_last_insert_rowid($this->db_handle->connection);
@@ -358,7 +360,7 @@ class rcube_db
*/
function _fetch_row($result, $mode)
{
- if (DB::isError($result))
+ if (!$result || DB::isError($result))
{
raise_error(array('code' => 500, 'type' => 'db', 'line' => __LINE__, 'file' => __FILE__,
'message' => $this->db_link->getMessage()), TRUE, FALSE);
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 9e1fc8cab..9f249d57b 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -878,7 +878,8 @@ class rcube_imap
{
$results = array();
foreach ($criteria as $crit)
- $results = array_merge($results, $this->search($mbox_name, $crit, $str, $charset));
+ if ($search_result = $this->search($mbox_name, $crit, $str, $charset))
+ $results = array_merge($results, $search_result);
$results = array_unique($results);
$this->set_search_set($criteria, $str, $results, $charset);