[BUGFIX] Prevent duplicated special char in backend breadcrumb 56/52856/2
authorThomas Schur <cyb10101@gmail.com>
Wed, 17 May 2017 11:09:03 +0000 (13:09 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 18 May 2017 16:28:38 +0000 (18:28 +0200)
Prevent duplicated special char conversion of page title in
TYPO3 backend breadcrumb and fix title cropping

Resolves: #81242
Releases: master, 8.7
Change-Id: Id7710d8d8f79e20b20f43569558833d3d3f68f16
Reviewed-on: https://review.typo3.org/52856
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Template/Components/MetaInformation.php

index 0fcf6a2..874d12a 100644 (file)
@@ -123,13 +123,13 @@ class MetaInformation
     /**
      * Setting page title
      *
-     * @return string Record title
+     * @return string Record title, already htmlspecialchar()'ed
      */
     public function getRecordInformationTitle()
     {
         $recordInformations = $this->getRecordInformations();
         if (!empty($recordInformations)) {
-            $title = htmlspecialchars($recordInformations['title']);
+            $title = $recordInformations['title'];
         } else {
             $title = '';
         }
@@ -137,14 +137,7 @@ class MetaInformation
         // crop the title to title limit (or 50, if not defined)
         $beUser = $this->getBackendUser();
         $cropLength = empty($beUser->uc['titleLen']) ? 50 : $beUser->uc['titleLen'];
-        $croppedTitle = GeneralUtility::fixed_lgd_cs($title, $cropLength);
-        if ($croppedTitle !== $title) {
-            $recordInformationTitle = htmlspecialchars($croppedTitle);
-        } else {
-            $recordInformationTitle = htmlspecialchars($title);
-        }
-
-        return $recordInformationTitle;
+        return htmlspecialchars(GeneralUtility::fixed_lgd_cs($title, $cropLength));
     }
 
     /**
@@ -231,7 +224,7 @@ class MetaInformation
         return [
             'uid' => $uid,
             'icon' => $theIcon,
-            'title' => htmlspecialchars($title),
+            'title' => $title,
             'additionalInfo' => $additionalInfo
         ];
     }