From d03685ce32e9ae65c7204da0eb49b08efe564bfb Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Tue, 24 May 2016 23:22:32 +0200
Subject: [PATCH] [TASK] Improve rendering of file paths in reports

By using the <code>-tag, the output of paths is improved:

- XCLASS usage
- Path to ENABLE_INSTALL_TOOL
- Path to deprecation log

Resolves: #76288
Releases: master, 7.6
Change-Id: I591009cd52ba1dec6d25ff135e76b7b536b84193
Reviewed-on: https://review.typo3.org/48282
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
---
 typo3/sysext/install/Classes/Report/SecurityStatusReport.php  | 4 ++--
 .../reports/Classes/Report/Status/ConfigurationStatus.php     | 2 +-
 typo3/sysext/reports/Classes/Report/Status/Typo3Status.php    | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/typo3/sysext/install/Classes/Report/SecurityStatusReport.php b/typo3/sysext/install/Classes/Report/SecurityStatusReport.php
index cca4fc6bee25..e22b2803b058 100644
--- a/typo3/sysext/install/Classes/Report/SecurityStatusReport.php
+++ b/typo3/sysext/install/Classes/Report/SecurityStatusReport.php
@@ -86,7 +86,7 @@ class SecurityStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
                 $disableInstallToolUrl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') . '&adminCmd=remove_ENABLE_INSTALL_TOOL';
                 $value = $GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_enabledPermanently');
                 $message = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.install_enabled'),
-                    '<span style="white-space: nowrap;">' . $enableInstallToolFile . '</span>');
+                    '<code style="white-space: nowrap;">' . $enableInstallToolFile . '</code>');
                 $message .= ' <a href="' . htmlspecialchars($disableInstallToolUrl) . '">' .
                     $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.install_enabled_cmd') . '</a>';
             } else {
@@ -97,7 +97,7 @@ class SecurityStatusReport implements \TYPO3\CMS\Reports\StatusProviderInterface
                     $disableInstallToolUrl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') . '&adminCmd=remove_ENABLE_INSTALL_TOOL';
                     $value = $GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_enabledTemporarily');
                     $message = sprintf($GLOBALS['LANG']->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_installEnabledTemporarily'),
-                        '<span style="white-space: nowrap;">' . $enableInstallToolFile . '</span>', floor((@filemtime($enableInstallToolFile) + EnableFileService::INSTALL_TOOL_ENABLE_FILE_LIFETIME - time()) / 60));
+                        '<code style="white-space: nowrap;">' . $enableInstallToolFile . '</code>', floor((@filemtime($enableInstallToolFile) + EnableFileService::INSTALL_TOOL_ENABLE_FILE_LIFETIME - time()) / 60));
                     $message .= ' <a href="' . htmlspecialchars($disableInstallToolUrl) . '">' .
                         $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.install_enabled_cmd') . '</a>';
                 }
diff --git a/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php b/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
index fac0d98c10fd..0815a4233a6b 100644
--- a/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
+++ b/typo3/sysext/reports/Classes/Report/Status/ConfigurationStatus.php
@@ -195,7 +195,7 @@ class ConfigurationStatus implements StatusProviderInterface
             $logFileSize = 0;
             if (@file_exists($logFile)) {
                 $logFileSize = filesize($logFile);
-                $message .= '<p>' . sprintf($this->getLanguageService()->getLL('status_configuration_DeprecationLogFile'), $this->getDeprecationLogFileLink()) . '</p>';
+                $message .= '<p>' . sprintf($this->getLanguageService()->getLL('status_configuration_DeprecationLogFile'), '<code>' . $this->getDeprecationLogFileLink()) . '</code></p>';
                 $removeDeprecationLogFileUrl = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL') . '&amp;adminCmd=removeDeprecationLogFile';
                 $message .= '<p>' . sprintf($this->getLanguageService()->getLL('status_configuration_DeprecationLogSize'), GeneralUtility::formatSize($logFileSize)) . ' <a href="' . $removeDeprecationLogFileUrl . '">' . $this->getLanguageService()->getLL('status_configuration_DeprecationLogDeleteLink') . '</a></p>';
             }
diff --git a/typo3/sysext/reports/Classes/Report/Status/Typo3Status.php b/typo3/sysext/reports/Classes/Report/Status/Typo3Status.php
index 753d4603246b..abc1875f6f4d 100644
--- a/typo3/sysext/reports/Classes/Report/Status/Typo3Status.php
+++ b/typo3/sysext/reports/Classes/Report/Status/Typo3Status.php
@@ -64,8 +64,8 @@ class Typo3Status implements StatusProviderInterface
             foreach ($xclassFoundArray as $originalClass => $xClassName) {
                 $messageDetail = sprintf(
                     $this->getLanguageService()->getLL('status_xclassUsageFound_message_detail'),
-                    $originalClass,
-                    $xClassName
+                    '<code>' . htmlspecialchars($originalClass) . '</code>',
+                    '<code>' . htmlspecialchars($xClassName) . '</code>'
                 );
                 $message .= '<li>' . $messageDetail . '</li>';
             }
-- 
GitLab