From edc1deaa3afcadab82d404e705e162a9f3fa26c5 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 6 Mar 2011 23:07:48 -0500 Subject: [PATCH] [ticket/10057] Skip ibase_service_attach if firebird connection failed. ibase_errmsg works for the most recent call. If the connection fails, any error message is clobbered by ibase_service_attach call. PHPBB3-10057 --- phpBB/includes/db/firebird.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index d1d88ffe42..660acb35db 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -70,7 +70,9 @@ class dbal_firebird extends dbal $this->db_connect_id = @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3); } - if (function_exists('ibase_service_attach') && $this->server) + // Do not call ibase_service_attach if connection failed, + // otherwise error message from ibase_(p)connect call will be clobbered. + if ($this->db_connect_id && function_exists('ibase_service_attach') && $this->server) { $this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword); }