diff options
| author | 2014-07-10 18:46:38 +0200 | |
|---|---|---|
| committer | 2014-07-10 18:46:38 +0200 | |
| commit | 52763ed97d0fd3ca96d11cbec361f5f4cf79fec4 (patch) | |
| tree | 7b433b9d172f59f58724a88923f297a9c03014ee /app/install.php | |
| parent | f56dd400b7175ef95232fc57bf276812494b3186 (diff) | |
Fix a bug during installation
- If MySQL database was configured and user choosed SQLite, an error was
raised at the first submit.
- Cast STEP into integer
Diffstat (limited to 'app/install.php')
| -rw-r--r-- | app/install.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/install.php b/app/install.php index 357a8e340..3767e3d91 100644 --- a/app/install.php +++ b/app/install.php @@ -10,13 +10,17 @@ session_set_cookie_params(0, dirname(empty($_SERVER['REQUEST_URI']) ? '/' : dirn session_start(); if (isset ($_GET['step'])) { - define ('STEP', $_GET['step']); + define ('STEP', (int)$_GET['step']); } else { define ('STEP', 1); } define('SQL_CREATE_DB', 'CREATE DATABASE IF NOT EXISTS %1$s DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;'); +if (STEP === 3 && isset($_POST['type'])) { + $_SESSION['bd_type'] = $_POST['type']; +} + if (isset($_SESSION['bd_type'])) { switch ($_SESSION['bd_type']) { case 'mysql': @@ -216,9 +220,6 @@ function saveStep2 () { function saveStep3 () { if (!empty ($_POST)) { - - $_SESSION['bd_type'] = isset ($_POST['type']) ? $_POST['type'] : ''; - if ($_SESSION['bd_type'] === 'sqlite') { $_SESSION['bd_base'] = $_SESSION['default_user']; $_SESSION['bd_host'] = ''; |
