diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-15415-DeprecateRemoveBadHTML.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-15415-DeprecateRemoveBadHTML.rst new file mode 100644 index 0000000000000000000000000000000000000000..a9ed1b87fba280a7becbc32d2a1f8109482afbf3 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-15415-DeprecateRemoveBadHTML.rst @@ -0,0 +1,31 @@ +============================================= +Deprecation: #15415 - Deprecate removeBadHTML +============================================= + +Description +=========== + +Due to the wrong approach of removeBadHTML it is not 100% complete and does not keep its promise. + +- :php:``ContentObjectRenderer::removeBadHTML()`` +- :typoscript:``stdWrap.removeBadHTML`` + + +Impact +====== + +Using the mentioned method or stdWrap property will trigger a deprecation log entry. + + +Affected Installations +====================== + +Instances that use the method or stdWrap property. + + +Migration +========= + +Implement a proper encoding by yourself. Use :php:``htmlspecialchars()`` or :typoscript:``stdWrap.htmlSpecialChars`` +in the context of HTML, :php:``GeneralUtility::quoteJSvalue()`` or :typoscript:``stdWrap.encodeForJavaScriptValue`` +in the context of JavaScript. diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php index 2ec93fdbd0c6ee517b3853e9e0ff453cb2f702d6..bac00bd00e30fe83580405cd27a4066c5a628799 100644 --- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php +++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php @@ -4033,9 +4033,11 @@ class ContentObjectRenderer * * @param string $text Input string to be cleaned. * @return string Return string + * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 */ public function removeBadHTML($text) { + GeneralUtility::logDeprecatedFunction(); // Copyright 2002-2003 Thomas Bley $text = preg_replace(array( '\'<script[^>]*?>.*?</script[^>]*?>\'si',