From 828d008bed8ef9abba047df16e5e09d8133bd3f3 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sat, 18 Jul 2015 12:01:26 +0200 Subject: fixed a postgresql-related bug, more database functions secured and add an exception for sqlite at installation --- install/index.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'install/index.php') diff --git a/install/index.php b/install/index.php index bb351095..ea5d7d47 100755 --- a/install/index.php +++ b/install/index.php @@ -94,10 +94,14 @@ else if (isset($_POST['install'])) { $errors[] = 'Impossible to create the SQLite database file. Please check your file permissions.'; } else { - $db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite'; - $handle = new PDO($db_path); - $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $sql_structure = ""; + try { + $db_path = 'sqlite:' . realpath('') . '/db/poche.sqlite'; + $handle = new PDO($db_path); + $handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $sql_structure = ""; + } catch (PDOException $e) { + $errors[] = "SQLite has encountered an issue : " . $e->getMessage(); + } } } else { // MySQL and Postgre -- cgit v1.2.3