[BUGFIX] Invalid closure in AbstractMenuContentObject
[Packages/TYPO3.CMS.git] / 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;
        }
 
        /**