diff options
Diffstat (limited to 'application')
-rw-r--r-- | application/Languages.php | 2 | ||||
-rw-r--r-- | application/config/ConfigPhp.php | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/application/Languages.php b/application/Languages.php index 357c7524..3eb3388f 100644 --- a/application/Languages.php +++ b/application/Languages.php | |||
@@ -69,6 +69,8 @@ class Languages | |||
69 | { | 69 | { |
70 | $this->conf = $conf; | 70 | $this->conf = $conf; |
71 | $confLanguage = $this->conf->get('translation.language', 'auto'); | 71 | $confLanguage = $this->conf->get('translation.language', 'auto'); |
72 | // Auto mode or invalid parameter, use the detected language. | ||
73 | // If the detected language is invalid, it doesn't matter, it will use English. | ||
72 | if ($confLanguage === 'auto' || ! $this->isValidLanguage($confLanguage)) { | 74 | if ($confLanguage === 'auto' || ! $this->isValidLanguage($confLanguage)) { |
73 | $this->language = substr($language, 0, 5); | 75 | $this->language = substr($language, 0, 5); |
74 | } else { | 76 | } else { |
diff --git a/application/config/ConfigPhp.php b/application/config/ConfigPhp.php index 2f66e8e0..8add8bcd 100644 --- a/application/config/ConfigPhp.php +++ b/application/config/ConfigPhp.php | |||
@@ -83,10 +83,10 @@ class ConfigPhp implements ConfigIO | |||
83 | 83 | ||
84 | $out = array(); | 84 | $out = array(); |
85 | foreach (self::$ROOT_KEYS as $key) { | 85 | foreach (self::$ROOT_KEYS as $key) { |
86 | $out[$key] = $GLOBALS[$key]; | 86 | $out[$key] = isset($GLOBALS[$key]) ? $GLOBALS[$key] : ''; |
87 | } | 87 | } |
88 | $out['config'] = $GLOBALS['config']; | 88 | $out['config'] = isset($GLOBALS['config']) ? $GLOBALS['config'] : []; |
89 | $out['plugins'] = !empty($GLOBALS['plugins']) ? $GLOBALS['plugins'] : array(); | 89 | $out['plugins'] = isset($GLOBALS['plugins']) ? $GLOBALS['plugins'] : []; |
90 | return $out; | 90 | return $out; |
91 | } | 91 | } |
92 | 92 | ||