[BUGFIX] t3lib_iconWorks must check if array exists before using it
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_iconworks.php
index 8a78110..321b8ac 100644 (file)
@@ -841,9 +841,11 @@ final class t3lib_iconWorks {
                        }
                }
                krsort($recordType);
-               foreach ($recordType as $iconName) {
-                       if (in_array($iconName, $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) {
-                               return $iconName;
+               if (is_array($GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) {
+                       foreach ($recordType as $iconName) {
+                               if (in_array($iconName, $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) {
+                                       return $iconName;
+                               }
                        }
                }
                return 'status-status-icon-missing';
@@ -942,10 +944,12 @@ final class t3lib_iconWorks {
                $priorities = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayPriorities'];
 
                $iconName = '';
-               foreach ($priorities as $priority) {
-                       if ($status[$priority]) {
-                               $iconName = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames'][$priority];
-                               break;
+               if (is_array($priorities)) {
+                       foreach ($priorities as $priority) {
+                               if ($status[$priority]) {
+                                       $iconName = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames'][$priority];
+                                       break;
+                               }
                        }
                }