check if $defaultLanguage is a valid string before we move on

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2017-12-01 16:14:51 +01:00
parent 8b734347b1
commit 2c3d97cc8f
No known key found for this signature in database
GPG Key ID: 2378A753E2BF04F6
1 changed files with 3 additions and 2 deletions

View File

@ -290,8 +290,9 @@ class Factory implements IFactory {
// use formal version of german ("Sie" instead of "Du") if the default
// language is set to 'de_DE' if possible
if (strtolower($lang) === 'de'
&& strtolower($defaultLanguage) === 'de_de' &&
if (is_string($defaultLanguage) &&
strtolower($lang) === 'de' &&
strtolower($defaultLanguage) === 'de_de' &&
$this->languageExists($app, 'de_DE')
) {
$result = 'de_DE';