summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/translator.inc.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/web/lib/translator.inc.php b/web/lib/translator.inc.php
index 58648c41..d10f8e90 100644
--- a/web/lib/translator.inc.php
+++ b/web/lib/translator.inc.php
@@ -111,14 +111,16 @@ function set_lang() {
$result = $dbh->query($q);
if ($result) {
- $row = $result->fetchAll();
- $LANG = $row[0];
+ $LANG = $result->fetchColumn(0);
+ if (!$LANG) {
+ unset($LANG);
+ }
}
$update_cookie = 1;
}
# Set $LANG to default if nothing is valid.
- if (!array_key_exists($LANG, $SUPPORTED_LANGS)) {
+ if (!isset($LANG) || !array_key_exists($LANG, $SUPPORTED_LANGS)) {
$LANG = config_get('options', 'default_lang');
}