sanity-fix: gettext and session mod check

Closes pull-request #152
This commit is contained in:
KuhnChris 2022-02-11 14:52:02 +00:00 committed by Deon George
parent 97eed9d9cd
commit 857f0c539c
2 changed files with 11 additions and 10 deletions

View File

@ -259,15 +259,16 @@ if ($app['language'] == 'auto') {
if ((substr($lang,0,2) == 'en') ||
(file_exists($app['language_dir']) && is_readable($app['language_dir']))) {
# Set language
putenv('LANG='.$lang); # e.g. LANG=de_DE
$lang .= '.UTF-8';
setlocale(LC_ALL,$lang); # set LC_ALL to de_DE
bindtextdomain('messages',LANGDIR);
bind_textdomain_codeset('messages','UTF-8');
textdomain('messages');
header('Content-type: text/html; charset=UTF-8',true);
if (extension_loaded('gettext')) {
# Set language
putenv('LANG='.$lang); # e.g. LANG=de_DE
$lang .= '.UTF-8';
setlocale(LC_ALL,$lang); # set LC_ALL to de_DE
bindtextdomain('messages',LANGDIR);
bind_textdomain_codeset('messages','UTF-8');
textdomain('messages');
header('Content-type: text/html; charset=UTF-8',true);
}
break;
}
}

View File

@ -376,7 +376,7 @@ class page {
'FOOT'=>true
);
if ($_SESSION[APPCONFIG]->getValue('appearance','minimalMode')) {
if (isset($_SESSION) && $_SESSION[APPCONFIG]->getValue('appearance','minimalMode')) {
$display = array(
'HEAD'=>false,
'CONTROL'=>false,