[BUGFIX] Variable was wrongly initialized
authorStefano Kowalke <blueduck@gmx.net>
Wed, 4 May 2011 18:48:18 +0000 (20:48 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 10 May 2011 12:09:24 +0000 (14:09 +0200)
Variable $codeLines should be initialized prior to being used
in a concatenation within the loop.

Change-Id: Ife0b44b937a33040f46402492a5ede6e99d39668
Resolves: #26622
Releases: 4.6
Reviewed-on: http://review.typo3.org/1927
Reviewed-by: Markus Klein
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/cms/tslib/class.tslib_menu.php

index a66e5e6..5940ae3 100644 (file)
@@ -3004,6 +3004,7 @@ class tslib_jsmenu extends tslib_menu {
                $parent = $count==1 ? 0 : $var.($count-1);
                $prev=0;
                $c=0;
+               $codeLines = '';
 
                $menuItems = is_array($menuItemArray) ? $menuItemArray : $this->sys_page->getMenu($pid);
                foreach($menuItems as $uid => $data)    {
@@ -3038,7 +3039,7 @@ class tslib_jsmenu extends tslib_menu {
                                                $url = $GLOBALS['TSFE']->baseUrlWrap($LD['totalURL']);
                                                $target = $LD['target'];
                                        }
-                                       $codeLines.=LF.$var.$count."=".$menuName.".add(".$parent.",".$prev.",0,".t3lib_div::quoteJSvalue($title, TRUE).",".t3lib_div::quoteJSvalue($url, TRUE).",".t3lib_div::quoteJSvalue($target, TRUE).");";
+                                       $codeLines .= LF . $var . $count . '=' . $menuName . '.add(' . $parent . ',' . $prev . ',0,' . t3lib_div::quoteJSvalue($title, TRUE) . ',' . t3lib_div::quoteJSvalue($url, TRUE) . ',' . t3lib_div::quoteJSvalue($target, TRUE) . ');';
                                                // If the active one should be chosen...
                                        $active = ($levelConf['showActive'] && $this->isActive($data['uid'], $MP_var));
                                                // If the first item should be shown