[BUGFIX] Prevent encoding of HTML entities in backend previews 94/10494/8
authorHelmut Hummel <helmut.hummel@typo3.org>
Tue, 27 Nov 2012 00:38:41 +0000 (01:38 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 12 Mar 2013 15:50:24 +0000 (16:50 +0100)
HTML entities that are used in HTML enabled fields should
be preserved for the preview instead of being encoded (twice).

Change-Id: I4f7b0b7214906f404a1cd1efba009a8cf577a18b
Fixes: #36067
Releases: 6.1
Reviewed-on: https://review.typo3.org/10494
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php

index 7baa2ee..037707d 100644 (file)
@@ -1628,7 +1628,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public function renderText($input) {
                $input = strip_tags($input);
                $input = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($input, 1500);
-               return nl2br(htmlspecialchars(trim($this->wordWrapper($input))));
+               return nl2br(htmlspecialchars(trim($this->wordWrapper($input)), ENT_QUOTES, 'UTF-8', FALSE));
        }
 
        /**
index d943e15..031674e 100644 (file)
@@ -739,9 +739,9 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
                if (!strcmp($code, '')) {
                        $code = '<i>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title', 1) . ']</i> - ' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle($table, $row), $GLOBALS['BE_USER']->uc['titleLen']));
                } else {
-                       $code = htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($code, $this->fixedL));
+                       $code = htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($code, $this->fixedL), ENT_QUOTES, 'UTF-8', FALSE);
                        if ($code != htmlspecialchars($origCode)) {
-                               $code = '<span title="' . htmlspecialchars($origCode) . '">' . $code . '</span>';
+                               $code = '<span title="' . htmlspecialchars($origCode, ENT_QUOTES, 'UTF-8', FALSE) . '">' . $code . '</span>';
                        }
                }
                switch ((string) $this->clickTitleMode) {