[TASK] Correct body-Tag id in Backend 51/47651/4
authorGianluigi Martino <gmartino27@gmail.com>
Wed, 13 Apr 2016 17:43:50 +0000 (19:43 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Apr 2016 08:29:39 +0000 (10:29 +0200)
Remove the beginning dash of the id in body-Tag by
stripping the forward slash from the route identifier.

Change-Id: I1454f5f51469ea17b9bdf5520b50c8da8825a73f
Resolves: #75525
Releases: master
Reviewed-on: https://review.typo3.org/47651
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Gianluigi Martino <gmartino27@gmail.com>
Tested-by: Gianluigi Martino <gmartino27@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Template/DocumentTemplate.php

index dc763f6..54c9ed1 100644 (file)
@@ -274,8 +274,8 @@ function jumpToUrl(URL) {
         // initialize Marker Support
         $this->templateService = GeneralUtility::makeInstance(MarkerBasedTemplateService::class);
 
-        // Setting default scriptID:
-        $this->scriptID = GeneralUtility::_GET('M') !== null ? GeneralUtility::_GET('M') : GeneralUtility::_GET('route');
+        // Setting default scriptID, trim forward slash from route
+        $this->scriptID = GeneralUtility::_GET('M') !== null ? GeneralUtility::_GET('M') : ltrim(GeneralUtility::_GET('route'), '/');
         $this->bodyTagId = preg_replace('/[^A-Za-z0-9-]/', '-', $this->scriptID);
         // Individual configuration per script? If so, make a recursive merge of the arrays:
         if (is_array($GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID])) {