From 020d06cdaac13372feef615b8689ad2526733243 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 7 Mar 2011 09:09:40 -0500 Subject: [PATCH] [ticket/10057] Handle the case of missing interbase extension better. PHPBB3-10057 --- phpBB/includes/db/firebird.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index fb820b4894..6786edb964 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -498,8 +498,24 @@ class dbal_firebird extends dbal */ function _sql_error() { + // Need special handling here because ibase_errmsg returns + // connection errors, however if the interbase extension + // is not installed then ibase_errmsg does not exist and + // we cannot call it. + if (function_exists('ibase_errmsg')) + { + $msg = @ibase_errmsg(); + if (!$msg) + { + $msg = $this->connect_error; + } + } + else + { + $msg = $this->connect_error; + } return array( - 'message' => @ibase_errmsg(), + 'message' => $msg, 'code' => (@function_exists('ibase_errcode') ? @ibase_errcode() : '') ); }