[BUGFIX] Invalid closure in AbstractMenuContentObject 74/32874/5
authorFrancois Suter <francois@typo3.org>
Thu, 18 Sep 2014 20:09:15 +0000 (22:09 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 19 Sep 2014 09:51:41 +0000 (11:51 +0200)
Issue #58792 introduced a closure in AbstractMenuContentObject.php
which is not PHP 5.3 compatible. Since TYPO3 6.2 must still
support PHP 5.3, and master should be for now.
The closure is replaced by a simple loop.

Resolves: #61721
Releases: 6.2, master
Change-Id: Icc65bf8f8feec1bc62fcf83d8a2f464db3141c0d
Reviewed-on: http://review.typo3.org/32874
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index ce686e5..76f417e 100644 (file)
@@ -914,9 +914,14 @@ class AbstractMenuContentObject {
         * @return array
         */
        protected function removeInaccessiblePages(array $pages) {
-               return array_filter($pages, function($page) {
-                       return $this->filterMenuPages($page, $this->getBannedUids(), $page['doktype'] === PageRepository::DOKTYPE_SPACER);
-               });
+               $banned = $this->getBannedUids();
+               $filteredPages = array();
+               foreach ($pages as $aPage) {
+                       if ($this->filterMenuPages($aPage, $banned, $aPage['doktype'] === PageRepository::DOKTYPE_SPACER)) {
+                               $filteredPages[] = $aPage;
+                       }
+               }
+               return $filteredPages;
        }
 
        /**