[BUGFIX] Remove php warning for RTE classes without name 67/42367/4
authorManuel Selbach <manuel_selbach@yahoo.de>
Fri, 7 Aug 2015 10:14:56 +0000 (12:14 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 7 Aug 2015 12:09:16 +0000 (14:09 +0200)
Check if name within the configuration is set
so that no PHP warning: illigal offset will be thrown

Resolves: #68068
Releases: master,6.2
Change-Id: I781fa237aa696e6e9b03714f8e1aca4124589d5f
Reviewed-on: http://review.typo3.org/42367
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php

index db78efe..6f63db8 100644 (file)
@@ -1036,7 +1036,11 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                if (is_array($RTEProperties['classes.'])) {
                        foreach ($RTEProperties['classes.'] as $className => $conf) {
                                $className = rtrim($className, '.');
-                               $classesArray['labels'][$className] = $this->getPageConfigLabel($conf['name'], FALSE);
+                               $label = '';
+                               if (!empty($conf['name'])) {
+                                       $label = $this->getPageConfigLabel($conf['name'], FALSE);
+                               }
+                               $classesArray['labels'][$className] = $label;
                                $classesArray['values'][$className] = str_replace('\\\'', '\'', $conf['value']);
                                if (isset($conf['noShow'])) {
                                        $classesArray['noShow'][$className] = $conf['noShow'];