[TASK] Use better implementation for array check 88/35388/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 13 Dec 2014 14:47:17 +0000 (15:47 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 13 Dec 2014 19:06:12 +0000 (20:06 +0100)
To suppress PHP warnings the input parameter must always be an array.
If there is nothing to merge, the array_merge_overrule function
must not be called at all.

Change-Id: Ice369449da22ff62c09efa919272195bd141e836
Resolves: #63827
Relates: #63701
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/35388
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index e3dad0f..3a1967d 100644 (file)
@@ -7008,7 +7008,7 @@ class ContentObjectRenderer {
                        $old_conf = $confArr[$prop . '.'];
                        list($name, $conf) = $cF->getVal($key, $GLOBALS['TSFE']->tmpl->setup);
                        if (is_array($old_conf) && count($old_conf)) {
-                               $conf = array_replace_recursive(is_array($conf) ? $conf : array(), $old_conf);
+                               $conf = is_array($conf) ? array_replace_recursive($conf, $old_conf) : $old_conf;
                        }
                        $confArr[$prop . '.'] = $conf;
                }