]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Check for valid database connection object.
authorRoland Haeder <roland@mxchange.org>
Mon, 18 Aug 2014 07:39:27 +0000 (09:39 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 18 Aug 2014 08:10:55 +0000 (10:10 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/installer.php

index dc4c7786a8d007c93155ad9f75a85e637f924573..cea7d29ec7df621801ffaeb934fc5fd7462b65ed 100644 (file)
@@ -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);