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

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';