[BUGFIX] Make sure that language key is set in extbase. 48/44348/2
authorEric Chavaillaz <eric@hemmer.ch>
Thu, 29 Oct 2015 11:17:50 +0000 (12:17 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 29 Oct 2015 12:08:44 +0000 (13:08 +0100)
If the TYPO3 context is BE and no user is logged (typically
in the login page), the language key is not set from the
browser's preferred language.

Resolves: #71097
Releases: master
Change-Id: I2521deb46083fccc2bff966b8b264a987689ee6a
Reviewed-on: https://review.typo3.org/44348
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Jérémie Roulin <jeremie@hemmer.ch>
Tested-by: Jérémie Roulin <jeremie@hemmer.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php

index 2c4e194..6246473 100644 (file)
@@ -206,8 +206,10 @@ class LocalizationUtility
                     }
                 }
             }
-        } elseif ($GLOBALS['BE_USER']->uc['lang'] !== '') {
+        } elseif (!empty($GLOBALS['BE_USER']->uc['lang'])) {
             self::$languageKey = $GLOBALS['BE_USER']->uc['lang'];
+        } elseif (!empty(self::getLanguageService()->lang)) {
+            self::$languageKey = self::getLanguageService()->lang;
         }
     }