[BUGFIX] XLIFF: Invalid handling of overlays for unavailable language
authorXavier Perseguers <xavier@typo3.org>
Sun, 30 Oct 2011 10:12:35 +0000 (11:12 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Tue, 1 Nov 2011 21:54:57 +0000 (22:54 +0100)
When a language is chosen but does not provide localization files for an
extension, the localization overlay mechanism fails to detect it and
provides NULL instead of an array to the array merge method of t3lib_div.

Change-Id: Ibf0aa0feadc16a77e61d515ae0c684bf182cf1a6
Fixes: #31353
Releases: 4.6, 4.7
Reviewed-on: http://review.typo3.org/6384
Reviewed-by: Thomas Juhnke
Tested-by: Thomas Juhnke
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/lang/lang.php

index 2b83b8f..fa24065 100755 (executable)
@@ -548,7 +548,7 @@ class language {
                        if (!isset($localLanguage[$this->lang])) {
                                $localLanguage[$this->lang] = $localLanguage['default'];
                        }
-                       if ($this->lang !== 'default') {
+                       if ($this->lang !== 'default' && isset($tempLL[$language])) {
                                        // Merge current language labels onto labels from previous language
                                        // This way we have a labels with fall back applied
                                $localLanguage[$this->lang] = t3lib_div::array_merge_recursive_overrule($localLanguage[$this->lang], $tempLL[$language], FALSE, FALSE);