From 2854c971482d930a1d17e06ca1b96807c19d65cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20K?= Date: Sun, 16 Aug 2015 14:33:33 +0200 Subject: [PATCH] Fix lang exist --- install.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.php b/install.php index e70cf8ae..7897f835 100755 --- a/install.php +++ b/install.php @@ -6,10 +6,9 @@ * Author Diego Najar * Bludit is opensource software licensed under the MIT license. */ - // Security constant define('BLUDIT', true); - + // Directory separator define('DS', DIRECTORY_SEPARATOR); @@ -61,7 +60,12 @@ include(PATH_ABSTRACT.'dbjson.class.php'); include(PATH_KERNEL.'dblanguage.class.php'); // Load language -$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); +$HTTP_ACCEPT_LANGUAGE = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); +if (file_exists(PATH_LANGUAGES.$HTTP_ACCEPT_LANGUAGE. '.json')) { + $locale = $HTTP_ACCEPT_LANGUAGE; +} else { + $locale = 'en_US'; +} $Language = new dbLanguage($locale); // ============================================================================