[BUGFIX] Invalid query part on menu rendering
authorOliver Hader <oliver@typo3.org>
Sun, 6 Nov 2011 15:34:09 +0000 (16:34 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Mon, 28 Nov 2011 16:59:13 +0000 (17:59 +0100)
Each page can have a target defined, which can also be a
typeNum that gets added to the generated URL. Now if RealURL
is used, the "&type=" part will be just added to the final
URL which looks like "page.html&type=1". A question mark
is missing here to get a valid query part.

Change-Id: I7c8c95db7eeb80709f5a9628d56be431ce1bdd76
Fixes: #31622
Releases: 4.7, 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/6565
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Reviewed-by: Simon Schaufelberger
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/cms/tslib/class.tslib_menu.php

index 996302f..b01e913 100644 (file)
@@ -1225,7 +1225,10 @@ class tslib_menu {
                if (preg_match('/([0-9]+[\s])?(([0-9]+)x([0-9]+))?(:.+)?/s', $LD['target'], $matches) || $targetIsType) {
                                // has type?
                        if(intval($matches[1]) || $targetIsType) {
-                               $LD['totalURL'] .= '&type=' . ($targetIsType ?  $targetIsType : intval($matches[1]));
+                               $LD['totalURL'] = $this->parent_cObj->URLqMark(
+                                       $LD['totalURL'],
+                                       '&type=' . ($targetIsType ? $targetIsType : intval($matches[1]))
+                               );
                                $LD['target'] = $targetIsType ?  '' : trim(substr($LD['target'], strlen($matches[1]) + 1));
                        }
                                // open in popup window?