[TASK] Deprecate removeBadHTML 01/48301/4
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 26 May 2016 18:50:36 +0000 (20:50 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 27 May 2016 09:48:43 +0000 (11:48 +0200)
Resolves: #15415
Releases: master
Change-Id: Iac92d6d36e2a84b069fa7c4a17d2dc567d952309
Reviewed-on: https://review.typo3.org/48301
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-15415-DeprecateRemoveBadHTML.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

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 (file)
index 0000000..a9ed1b8
--- /dev/null
@@ -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.
index 2ec93fd..bac00bd 100644 (file)
@@ -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',