From 3394510949fbe4fff14a5028a15fdee12ef8b9ea Mon Sep 17 00:00:00 2001
From: "J. Peter M. Schuler" <j.peter.m.schuler@uni-due.de>
Date: Sat, 19 Nov 2022 01:14:34 +0100
Subject: [PATCH] [BUGFIX] Avoid undefined array key in
 ContentObjectRenderer::stdWrap

Resolves: #99134
Releases: main, 11.5
Change-Id: I4ec448a0d06f5614cdc35e7f695c692e4080fbc3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76699
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Nikita Hovratov <nikita.h@live.de>
Reviewed-by: Nikita Hovratov <nikita.h@live.de>
---
 .../Classes/ContentObject/ContentObjectRenderer.php         | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index a1a1a367f73c..62bb6b0a3bea 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -1197,8 +1197,8 @@ class ContentObjectRenderer implements LoggerAwareInterface
                     }
                 }
                 // Check if key is still containing something, since it might have been changed by next level stdWrap before
-                if ((isset($conf[$functionName]) || $conf[$functionProperties])
-                    && ($functionType !== 'boolean' || $conf[$functionName])
+                if ((isset($conf[$functionName]) || ($conf[$functionProperties] ?? null))
+                    && ($functionType !== 'boolean' || ($conf[$functionName] ?? null))
                 ) {
                     // Get just that part of $conf that is needed for the particular function
                     $singleConf = [
@@ -1215,7 +1215,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
                     // Call the function with the prefix stdWrap_ to make sure nobody can execute functions just by adding their name to the TS Array
                     $functionName = 'stdWrap_' . $functionName;
                     $content = $this->{$functionName}($content, $singleConf);
-                } elseif ($functionType === 'boolean' && !$conf[$functionName]) {
+                } elseif ($functionType === 'boolean' && !($conf[$functionName] ?? null)) {
                     $isExecuted[$functionName] = true;
                     $isExecuted[$functionProperties] = true;
                 }
-- 
GitLab