Skip to content
Snippets Groups Projects
Commit 0873a918 authored by Benni Mack's avatar Benni Mack Committed by Christian Kuhn
Browse files

[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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 7d94e5a0
Branches
Tags
No related merge requests found
.. 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
...@@ -114,7 +114,7 @@ class ArrayBrowser ...@@ -114,7 +114,7 @@ class ArrayBrowser
$output .= '<span class="list-tree-group">'; $output .= '<span class="list-tree-group">';
$output .= $this->wrapArrayKey($key, $depth, !$isArray ? $value : ''); $output .= $this->wrapArrayKey($key, $depth, !$isArray ? $value : '');
if (!$isArray) { if (!$isArray) {
$output .= ' = <span class="list-tree-value">' . $this->wrapValue($value) . '</span>'; $output .= ' = <span class="list-tree-value">' . htmlspecialchars($value) . '</span>';
} }
$output .= '</span>'; $output .= '</span>';
if ($isExpanded) { if ($isExpanded) {
...@@ -134,9 +134,11 @@ class ArrayBrowser ...@@ -134,9 +134,11 @@ class ArrayBrowser
* *
* @param string $theValue The title string * @param string $theValue The title string
* @return string Title string, htmlspecialchars()'ed * @return string Title string, htmlspecialchars()'ed
* @deprecated since TYPO3 v8, will be removed in TYPO3 v9
*/ */
public function wrapValue($theValue) public function wrapValue($theValue)
{ {
GeneralUtility::logDeprecatedFunction();
$wrappedValue = ''; $wrappedValue = '';
if ((string)$theValue !== '') { if ((string)$theValue !== '') {
$wrappedValue = htmlspecialchars($theValue); $wrappedValue = htmlspecialchars($theValue);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment