[BUGFIX] Check if value is array to prevent a PHP warning 42/43842/2
authorFrans Saris <franssaris@gmail.com>
Tue, 6 Oct 2015 07:16:51 +0000 (09:16 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 6 Oct 2015 20:20:17 +0000 (22:20 +0200)
Change-Id: I81dc99c9961ab817ad16a44c53f4c150e2bedba7
Resolves: #70423
Releases: master
Reviewed-on: http://review.typo3.org/43842
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/form/Classes/Domain/Repository/TypoScriptRepository.php

index f6766cb..132c67a 100644 (file)
@@ -92,11 +92,15 @@ class TypoScriptRepository implements SingletonInterface {
                        return array();
                }
                $htmlAttributes = $this->getModelConfigurationByScope($elementType, 'htmlAttributes.');
-               $htmlAttributes = array_fill_keys($htmlAttributes, null);
+               if (is_array($htmlAttributes)) {
+                       $htmlAttributes = array_fill_keys($htmlAttributes, NULL);
+               } else {
+                       $htmlAttributes = array();
+               }
                $defaultHtmlAttributeValues = $this->getModelConfigurationByScope($elementType, 'defaultHtmlAttributeValues.');
                if (is_array($defaultHtmlAttributeValues)) {
-                       foreach ($defaultHtmlAttributeValues as $defaultHtmlAttributeKey => $defaultHtmlAttibuteValue) {
-                               $htmlAttributes[$defaultHtmlAttributeKey] = $defaultHtmlAttibuteValue;
+                       foreach ($defaultHtmlAttributeValues as $defaultHtmlAttributeKey => $defaultHtmlAttributeValue) {
+                               $htmlAttributes[$defaultHtmlAttributeKey] = $defaultHtmlAttributeValue;
                        }
                } elseif (!is_array($htmlAttributes)) {
                        $htmlAttributes = array();