[BUGFIX] Correct declaration of $rL_uidRegister 74/50974/5
authorKasper Ligaard <kasperligaard+typo3.org@gmail.com>
Thu, 15 Dec 2016 12:30:42 +0000 (13:30 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 11 Jan 2017 08:43:50 +0000 (09:43 +0100)
$rL_uidRegister was declared as a string but was
used as an array therefore in PHP 7.1 an exception was
thrown.

This is a delayed backport of https://review.typo3.org/48799/.

Resolves: #79001
Related: #76934
Releases: 7.6
Change-Id: Ia0285bb60b6f0f9c5ccde732cce33505c195eb0a
Reviewed-on: https://review.typo3.org/50974
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Cedric Ziel <cedric@cedric-ziel.com>
Tested-by: Cedric Ziel <cedric@cedric-ziel.com>
Reviewed-by: Kevin Ditscheid <kevinditscheid@gmail.com>
Tested-by: Kevin Ditscheid <kevinditscheid@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index 4b9956d..c07723f 100644 (file)
@@ -163,9 +163,9 @@ abstract class AbstractMenuContentObject
      * Is filled with an array of page uid numbers + RL parameters which are in the current
      * root line (used to evaluate whether a menu item is in active state)
      *
-     * @var string
+     * @var array
      */
-    public $rL_uidRegister = '';
+    public $rL_uidRegister;
 
     /**
      * @var string
@@ -344,7 +344,8 @@ abstract class AbstractMenuContentObject
             }
             // Gather list of page uids in root line (for "isActive" evaluation). Also adds the MP params in the path so Mount Points are respected.
             // (List is specific for this rootline, so it may be supplied from parent menus for speed...)
-            if (!is_array($this->rL_uidRegister)) {
+            if ($this->rL_uidRegister === null) {
+                $this->rL_uidRegister = [];
                 $rl_MParray = [];
                 foreach ($this->tmpl->rootLine as $v_rl) {
                     // For overlaid mount points, set the variable right now: