[BUGFIX] Ensure argument is an array in ContentObjectRenderer 63/33263/2
authorkaystrobach <typo3@kay-strobach.de>
Fri, 10 Oct 2014 06:49:50 +0000 (08:49 +0200)
committerMarkus Klein <klein.t3@reelworx.at>
Sat, 11 Oct 2014 12:58:04 +0000 (14:58 +0200)
This patch ensures that at least an empty array is passed to the
array_replace_recursive function to avoid warnings during rendering.

Inspired by Markus Klein

Resolves: #62139
Releases: master, 6.2
Change-Id: I854b39d7ff54c213bda00dd9060c1e5ee89914eb
Reviewed-on: http://review.typo3.org/33263
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 289b82c..49dc492 100644 (file)
@@ -725,11 +725,9 @@ class ContentObjectRenderer {
                                $key = trim(substr($name, 1));
                                $cF = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
                                // $name and $conf is loaded with the referenced values.
-                               $old_conf = $conf;
+                               $confOverride = is_array($conf) ? $conf : array();
                                list($name, $conf) = $cF->getVal($key, $GLOBALS['TSFE']->tmpl->setup);
-                               if (is_array($old_conf) && count($old_conf)) {
-                                       $conf = array_replace_recursive($conf, $old_conf);
-                               }
+                               $conf = array_replace_recursive(is_array($conf) ? $conf : array(), $confOverride);
                                // Getting the cObject
                                $GLOBALS['TT']->incStackPointer();
                                $content .= $this->cObjGetSingle($name, $conf, $key);