From b0b0eac1cf441fc9f1d5123d82227a026b968693 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 13 Mar 2014 16:39:11 +0100 Subject: [PATCH] redirect user in install process if database connection settings are wrong --- web/install/bdd.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/install/bdd.php b/web/install/bdd.php index 8e9561876..50303f73a 100644 --- a/web/install/bdd.php +++ b/web/install/bdd.php @@ -32,8 +32,13 @@ if (isset($_POST['host']) && isset($_POST['username']) && isset($_POST['passwor $_SESSION['install']['port'] = $_POST['port']; $checkConnection = new \Thelia\Install\CheckDatabaseConnection($_POST['host'], $_POST['username'], $_POST['password'], $_POST['port']); + if(!$checkConnection->exec()) { + header('location: connection.php?err=1'); + exit; + } $databases = $checkConnection->getConnection()->query('SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA'); - if(! $checkConnection->exec() || $databases === false){ + + if(false === $databases){ header('location: connection.php?err=1'); exit; }