[BUGFIX] Avoid stripping tags for generating diffs 33/51933/2
authorGeorg Ringer <georg.ringer@gmail.com>
Mon, 9 Jan 2017 18:16:10 +0000 (19:16 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 3 Mar 2017 00:12:33 +0000 (01:12 +0100)
Tags must not be stripped away for creating diffs as
those are essential for editors. Otherwise it is not
possible to see changed links or changing a header from
h1 to h2.

Resolves: #78767
Resolves: #79205
Releases: master, 7.6
Change-Id: Icb174f3522354fa8ef5d2b8ccca039e33ef472e7
Reviewed-on: https://review.typo3.org/51933
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php
typo3/sysext/backend/Classes/History/RecordHistory.php
typo3/sysext/version/Classes/Controller/VersionModuleController.php
typo3/sysext/workspaces/Classes/Service/HistoryService.php

index 3c51abb..c264f86 100644 (file)
@@ -419,6 +419,7 @@ class SingleFieldContainer extends AbstractContainer
                     // Create diff-result:
                     /** @var DiffUtility $diffUtility */
                     $diffUtility = GeneralUtility::makeInstance(DiffUtility::class);
+                    $diffUtility->stripTags = false;
                     $diffres = $diffUtility->makeDiffDisplay(
                         BackendUtility::getProcessedValue($table, $field, $dLVal['old'][$field], 0, 1),
                         BackendUtility::getProcessedValue($table, $field, $dLVal['new'][$field], 0, 1)
index 39223c6..1857652 100644 (file)
@@ -616,6 +616,7 @@ class RecordHistory
         $lines = [];
         if (is_array($entry['newRecord'])) {
             $diffUtility = GeneralUtility::makeInstance(DiffUtility::class);
+            $diffUtility->stripTags = false;
             $fieldsToDisplay = array_keys($entry['newRecord']);
             $languageService = $this->getLanguageService();
             foreach ($fieldsToDisplay as $fN) {
index fc9b9db..3eb17d6 100644 (file)
@@ -291,6 +291,7 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
                 $diff_2_record = BackendUtility::getRecord($this->table, $diff_2);
                 if (is_array($diff_1_record) && is_array($diff_2_record)) {
                     $diffUtility = GeneralUtility::makeInstance(DiffUtility::class);
+                    $diffUtility->stripTags = false;
                     $rows = [];
                     $rows[] = '
                                                                        <tr>
index 0be6747..c072094 100644 (file)
@@ -161,6 +161,7 @@ class HistoryService implements \TYPO3\CMS\Core\SingletonInterface
     {
         if (!isset($this->differencesObject)) {
             $this->differencesObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Utility\DiffUtility::class);
+            $this->differencesObject->stripTags = false;
         }
         return $this->differencesObject;
     }