[ticket/10205] Avoid calling mysqli functions when mysqli is missing.

PHPBB3-10205
This commit is contained in:
Oleg Pudeyev 2012-12-04 04:06:30 -05:00
parent 025a95ea90
commit 1a7e2211c3

View file

@ -425,10 +425,20 @@ class dbal_mysqli extends dbal
{ {
if (!$this->db_connect_id) if (!$this->db_connect_id)
{ {
return array( if (function_exists('mysqli_connect_error'))
'message' => @mysqli_connect_error(), {
'code' => @mysqli_connect_errno() return array(
); 'message' => @mysqli_connect_error(),
'code' => @mysqli_connect_errno(),
);
}
else
{
return array(
'message' => $this->connect_error,
'code' => '',
);
}
} }
return array( return array(