don't make documentroot include domain-name by default (forgot on update); remove possible undefined index; beautification for template-forms, thx to monumentum
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
28
lib/init.php
28
lib/init.php
@@ -307,21 +307,23 @@ if (isset($userinfo['language']) && isset($languages[$userinfo['language']])) {
|
||||
) {
|
||||
$language = $_GET['language'];
|
||||
} else {
|
||||
$accept_langs = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
for($i = 0; $i<count($accept_langs); $i++) {
|
||||
// this only works for most common languages. some (uncommon) languages have a 3 letter iso-code.
|
||||
// to be able to use these also, we would have to depend on the intl extension for php (using Locale::lookup or similar)
|
||||
// as long as froxlor does not support any of these languages, we can leave it like that.
|
||||
if (isset($iso[substr($accept_langs[$i],0,2)])) {
|
||||
$language=$iso[substr($accept_langs[$i],0,2)];
|
||||
break;
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
$accept_langs = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
for($i = 0; $i<count($accept_langs); $i++) {
|
||||
// this only works for most common languages. some (uncommon) languages have a 3 letter iso-code.
|
||||
// to be able to use these also, we would have to depend on the intl extension for php (using Locale::lookup or similar)
|
||||
// as long as froxlor does not support any of these languages, we can leave it like that.
|
||||
if (isset($iso[substr($accept_langs[$i],0,2)])) {
|
||||
$language=$iso[substr($accept_langs[$i],0,2)];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($iso);
|
||||
unset($iso);
|
||||
|
||||
// if HTTP_ACCEPT_LANGUAGES has no valid langs, use default (very unlikely)
|
||||
if (!strlen($language)>0) {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
// if HTTP_ACCEPT_LANGUAGES has no valid langs, use default (very unlikely)
|
||||
if (!strlen($language)>0) {
|
||||
$language = $settings['panel']['standardlanguage'];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user