From: Roland Haeder Date: Mon, 18 Aug 2014 07:39:27 +0000 (+0200) Subject: Check for valid database connection object. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=571ba1369b7598f7a5c3c154363f72c74b1ed1ad;p=quix0rs-gnu-social.git Check for valid database connection object. Signed-off-by: Roland Haeder --- diff --git a/lib/installer.php b/lib/installer.php index dc4c7786a8..cea7d29ec7 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -293,6 +293,11 @@ abstract class Installer } } + if (!$conn instanceof DB_common) { + // Is not the right instance + throw new Exception('Cannot connect to database: ' . $conn->getMessage()); + } + $res = $this->updateStatus("Creating database tables..."); if (!$this->createCoreTables($conn)) { $this->updateStatus("Error creating tables.", true);