From 0873a918a44756aaab2cd80304495f17ec28f008 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Sat, 25 Mar 2017 18:05:14 +0100 Subject: [PATCH] [TASK] Deprecate EXT:lowlevel ArrayBrowser->wrapValue The method ArrayBrowser->wrapValue() only does a htmlspecialchars() call nowadays and can be replaced easily by PHP native functions. Resolves: #80440 Releases: master Change-Id: I1646adc0c501b386ed289f428420b3e6ec6a5000 Reviewed-on: https://review.typo3.org/52153 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> --- ...0440-EXTlowlevelArrayBrowser-wrapValue.rst | 33 +++++++++++++++++++ .../lowlevel/Classes/Utility/ArrayBrowser.php | 4 ++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-80440-EXTlowlevelArrayBrowser-wrapValue.rst diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80440-EXTlowlevelArrayBrowser-wrapValue.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80440-EXTlowlevelArrayBrowser-wrapValue.rst new file mode 100644 index 000000000000..5d98c5c45c5d --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80440-EXTlowlevelArrayBrowser-wrapValue.rst @@ -0,0 +1,33 @@ +.. include:: ../../Includes.txt + +========================================================== +Deprecation: #80440 - EXT:lowlevel ArrayBrowser->wrapValue +========================================================== + +See :issue:`80440` + +Description +=========== + +The method ``ArrayBrowser->wrapValue`` in EXT:lowlevel has been marked as deprecated, since the sole +logic was to wrap the incoming string into htmlspecialchars(). + + +Impact +====== + +Calling the method will trigger a deprecation warning. + + +Affected Installations +====================== + +Any TYPO3 installation using the EXT:lowlevel ArrayBrowser class in a custom extension. + + +Migration +========= + +Remove the call to the method and directly use ``htmlspecialchars()`` instead. + +.. index:: PHP-API \ No newline at end of file diff --git a/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php b/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php index 198f2c5153bf..b6b7709de68f 100644 --- a/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php +++ b/typo3/sysext/lowlevel/Classes/Utility/ArrayBrowser.php @@ -114,7 +114,7 @@ class ArrayBrowser $output .= '<span class="list-tree-group">'; $output .= $this->wrapArrayKey($key, $depth, !$isArray ? $value : ''); if (!$isArray) { - $output .= ' = <span class="list-tree-value">' . $this->wrapValue($value) . '</span>'; + $output .= ' = <span class="list-tree-value">' . htmlspecialchars($value) . '</span>'; } $output .= '</span>'; if ($isExpanded) { @@ -134,9 +134,11 @@ class ArrayBrowser * * @param string $theValue The title string * @return string Title string, htmlspecialchars()'ed + * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 */ public function wrapValue($theValue) { + GeneralUtility::logDeprecatedFunction(); $wrappedValue = ''; if ((string)$theValue !== '') { $wrappedValue = htmlspecialchars($theValue); -- GitLab