Skip to content
Snippets Groups Projects
Commit 2474d169 authored by J. Peter M. Schuler's avatar J. Peter M. Schuler Committed by Stefan Bürk
Browse files

[BUGFIX] Avoid undefined array key access in LanguageMenuProcessor

While the assumption that sys_language_uid 0 is enabled is probably
always true, there are scenarios where this isn't the case (e.g.
disabling sys_language_uid 0 for different default languages on
different sites while still allowing cross-domain-links in the correct
language).

In PHP 7.4 the LanguageMenuProcessor did a graceful fallback to nothing,
in PHP 8.1 calling a LanguageMenuProcessor with disabled base language
results in an exception `Trying to access array offset on value of type
null`

Resolves: #99156
Releases: main, 11.5
Change-Id: I443e94f6dd45d7462f5925ff014a5bfc0df40ef8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76779


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 6ce29494
Branches
Tags
No related merge requests found
......@@ -482,7 +482,7 @@ class LanguageMenuProcessor implements DataProcessorInterface
if ($language->enabled()) {
$language = $language->toArray();
} else {
$language = null;
return $this->jsonEncode(null);
}
// Check field for return exists
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment