[BUGFIX] Ensure "0" is treated as proper fallback in site language
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Site / Entity / SiteLanguage.php
index 033596a..0064027 100644 (file)
@@ -154,10 +154,16 @@ class SiteLanguage
         if (isset($configuration['fallbacks'])) {
             $fallbackLanguageIds = $configuration['fallbacks'];
 
+            // It is important to distinct between "0" and "" so, empty() should not be used here
             if (is_string($fallbackLanguageIds)) {
-                $fallbackLanguageIds = explode(',', $fallbackLanguageIds);
+                if ($fallbackLanguageIds !== '') {
+                    $fallbackLanguageIds = explode(',', $fallbackLanguageIds);
+                } else {
+                    $fallbackLanguageIds = [];
+                }
+            } elseif (is_scalar($fallbackLanguageIds)) {
+                $fallbackLanguageIds = [$fallbackLanguageIds];
             }
-
             $this->fallbackLanguageIds = array_map('intval', $fallbackLanguageIds);
         }
         if (isset($configuration['enabled'])) {