Skip to content
Snippets Groups Projects
Commit 61d4c557 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[BUGFIX] Avoid native PHP warnings in FrontendBackendUserAuthentication

Avoid native PHP warnings in FrontendBackendUserAuthentication
because of invalid array key access. The places are now guarded
using null coalescing operator with a suitable fallback value.

Resolves: #101848
Resolves: #101847
Releases: main, 12.4, 11.5
Change-Id: Iaf747172b6ac04b9d2bdbf60519346ef7e3b3f2f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80845


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 9f5b375f
No related merge requests found
......@@ -104,7 +104,7 @@ class FrontendBackendUserAuthentication extends BackendUserAuthentication
$languageId = $languageAspect->getId();
} elseif ($table === 'tt_content') {
$languageId = $languageAspect->getContentId();
} elseif ($GLOBALS['TCA'][$table]['ctrl']['languageField']) {
} elseif ($GLOBALS['TCA'][$table]['ctrl']['languageField'] ?? false) {
$languageId = $currentRecord[$GLOBALS['TCA'][$table]['ctrl']['languageField']];
} else {
$languageId = -1;
......@@ -176,7 +176,7 @@ class FrontendBackendUserAuthentication extends BackendUserAuthentication
{
$types = GeneralUtility::trimExplode(',', strtolower($conf['allow']), true);
$allow = array_flip($types);
if (!$conf['onlyCurrentPid'] || $pid == $GLOBALS['TSFE']->id) {
if (!($conf['onlyCurrentPid'] ?? false) || $pid == $GLOBALS['TSFE']->id) {
// Permissions
$types = GeneralUtility::trimExplode(',', strtolower($conf['allow']), true);
$allow = array_flip($types);
......
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