From: VirtualTam Date: Fri, 10 Jul 2015 20:53:43 +0000 (+0200) Subject: Fix: data/config.php was not imported X-Git-Tag: v0.5.0~11^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=50c9a12ee65e4c279af6f8e67f7202954af0f80c;hp=49ca75695019865a3c57323a1d5c3c8c62ca124f;p=github%2Fshaarli%2FShaarli.git Fix: data/config.php was not imported Relates to #255 Signed-off-by: VirtualTam --- diff --git a/index.php b/index.php index 236fd4e2..8058a745 100644 --- a/index.php +++ b/index.php @@ -63,6 +63,11 @@ checkphpversion(); error_reporting(E_ALL^E_WARNING); // See all error except warnings. //error_reporting(-1); // See all errors (for debugging only) +// User configuration +if (is_file($GLOBALS['config']['CONFIG_FILE'])) { + require_once $GLOBALS['config']['CONFIG_FILE']; +} + // Shaarli library require_once 'application/LinkDB.php'; require_once 'application/Utils.php'; @@ -103,9 +108,10 @@ if (empty($GLOBALS['titleLink'])) $GLOBALS['titleLink']='?'; // I really need to rewrite Shaarli with a proper configuation manager. // Run config screen if first run: -if (!is_file($GLOBALS['config']['CONFIG_FILE'])) install(); +if (! is_file($GLOBALS['config']['CONFIG_FILE'])) { + install(); +} -require $GLOBALS['config']['CONFIG_FILE']; // Read login/password hash into $GLOBALS. $GLOBALS['title'] = !empty($GLOBALS['title']) ? escape($GLOBALS['title']) : ''; $GLOBALS['titleLink'] = !empty($GLOBALS['titleLink']) ? escape($GLOBALS['titleLink']) : ''; $GLOBALS['redirector'] = !empty($GLOBALS['redirector']) ? escape($GLOBALS['redirector']) : '';