From fe2f0be4352ba0bc213a2c6d4dfcbbddea1a551c Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 21 Aug 2012 04:50:14 -0400
Subject: [PATCH] Fix possible PHP warning, read default_folders using config->get() to support deprecated option name (default_imap_folders)
---
program/include/rcube_db.php | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/program/include/rcube_db.php b/program/include/rcube_db.php
index 01abfc8..f97d70a 100644
--- a/program/include/rcube_db.php
+++ b/program/include/rcube_db.php
@@ -268,15 +268,15 @@
*
* @param int $res_id Optional query result identifier
*
- * @return boolean True on error, False otherwise
+ * @return string Error message
*/
public function is_error($res_id = null)
{
if ($res_id !== null) {
- return $this->_get_result($res_id) === false;
+ return $this->_get_result($res_id) === false ? $this->db_error_msg : null;
}
- return $this->db_error;
+ return $this->db_error ? $this->db_error_msg : null;
}
/**
@@ -576,6 +576,10 @@
return intval($input);
}
+ if (is_null($input)) {
+ return 'NULL';
+ }
+
// create DB handle if not available
if (!$this->dbh) {
$this->db_connect('r');
--
Gitblit v1.9.1