]> git.joonet.de Git - adminer.git/commitdiff
Handle exception when creating SQLite database
authorJakub Vrana <jakub@vrana.cz>
Fri, 20 Dec 2013 23:37:39 +0000 (15:37 -0800)
committerJakub Vrana <jakub@vrana.cz>
Fri, 20 Dec 2013 23:37:39 +0000 (15:37 -0800)
adminer/drivers/sqlite.inc.php

index 51ccf2b160ae775092eb47d0c0d1393cf7533831..99867d29a46b6850f75f28a0dfd8f68d8f6b4fb6 100644 (file)
@@ -422,7 +422,12 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                if (!check_sqlite_name($db)) {
                        return false;
                }
-               $link = new Min_SQLite($db); //! exception handler
+               try {
+                       $link = new Min_SQLite($db);
+               } catch (Exception $ex) {
+                       $connection->error = $ex->getMessage();
+                       return false;
+               }
                $link->query('PRAGMA encoding = "UTF-8"');
                $link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file
                $link->query('DROP TABLE adminer');