[FOLLOWUP][TASK] Move xhtml_cleaning check to compatibility6 36/36536/2
authorBenjamin Mack <benni@typo3.org>
Sat, 31 Jan 2015 18:00:27 +0000 (19:00 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 31 Jan 2015 18:02:11 +0000 (19:02 +0100)
Resolves: #62855
Releases: master
Change-Id: I5148e6fe06a73308283bb5f42427cef3d814dbfa
Reviewed-on: http://review.typo3.org/36536
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/compatibility6/Classes/Hooks/TypoScriptFrontendController/ContentPostProcHook.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 1690932..621c45f 100644 (file)
@@ -14,6 +14,9 @@ namespace TYPO3\CMS\Compatibility6\Hooks\TypoScriptFrontendController;
  * The TYPO3 project - inspiring people to share!
  */
 
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+use \TYPO3\CMS\Core\Html\HtmlParser;
+
 /**
  * Class that hooks into TypoScriptFrontendController to do XHTML cleaning
  */
@@ -28,15 +31,15 @@ class ContentPostProcHook {
         * XHTML-clean the code, if flag config.xhtml_cleaning is set
         * to "all"
         *
-        * @param $parameters array
-        * @param $parentObject \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
+        * @param array $parameters
+        * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $parentObject
         */
        public function contentPostProcAll(&$parameters, $parentObject) {
                $this->pObj = $parentObject;
                // XHTML-clean the code, if flag set
-               if ($this->doXHTML_cleaning() == 'all') {
+               if ($this->doXHTML_cleaning() === 'all') {
                        $GLOBALS['TT']->push('XHTML clean, all', '');
-                       $XHTML_clean = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\HtmlParser::class);
+                       $XHTML_clean = GeneralUtility::makeInstance(HtmlParser::class);
                        $this->pObj->content = $XHTML_clean->XHTML_clean($this->pObj->content);
                        $GLOBALS['TT']->pull();
                }
@@ -46,15 +49,15 @@ class ContentPostProcHook {
         * XHTML-clean the code, if flag config.xhtml_cleaning is set
         * to "cached"
         *
-        * @param $parameters array
-        * @param $parentObject \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
+        * @param array $parameters
+        * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $parentObject
         */
        public function contentPostProcCached(&$parameters, $parentObject) {
                $this->pObj = $parentObject;
                // XHTML-clean the code, if flag set
-               if ($this->doXHTML_cleaning() == 'cached') {
+               if ($this->doXHTML_cleaning() === 'cached') {
                        $GLOBALS['TT']->push('XHTML clean, cached', '');
-                       $XHTML_clean = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\HtmlParser::class);
+                       $XHTML_clean = GeneralUtility::makeInstance(HtmlParser::class);
                        $this->pObj->content = $XHTML_clean->XHTML_clean($this->pObj->content);
                        $GLOBALS['TT']->pull();
                }
@@ -64,15 +67,15 @@ class ContentPostProcHook {
         * XHTML-clean the code, if flag config.xhtml_cleaning is set
         * to "output"
         *
-        * @param $parameters array
-        * @param $parentObject \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
+        * @param array $parameters
+        * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $parentObject
         */
        public function contentPostProcOutput(&$parameters, $parentObject) {
                $this->pObj = $parentObject;
                // XHTML-clean the code, if flag set
-               if ($this->doXHTML_cleaning() == 'output') {
+               if ($this->doXHTML_cleaning() === 'output') {
                        $GLOBALS['TT']->push('XHTML clean, output', '');
-                       $XHTML_clean = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Html\HtmlParser::class);
+                       $XHTML_clean = GeneralUtility::makeInstance(HtmlParser::class);
                        $this->pObj->content = $XHTML_clean->XHTML_clean($this->pObj->content);
                        $GLOBALS['TT']->pull();
                }
@@ -81,10 +84,10 @@ class ContentPostProcHook {
        /**
         * Returns the mode of XHTML cleaning
         *
-        * @return string Keyword: "all", "cached" or "output"
+        * @return string Keyword: "all", "cached", "none" or "output"
         */
        protected function doXHTML_cleaning() {
-               if ($this->pObj->config['config']['xmlprologue'] == 'none') {
+               if ($this->pObj->config['config']['xmlprologue'] === 'none') {
                        return 'none';
                }
                return $this->pObj->config['config']['xhtml_cleaning'];
index fd8dfdc..6f6ab62 100644 (file)
@@ -1442,9 +1442,8 @@ class HtmlParser {
         * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public function XHTML_clean($content) {
-               GeneralUtility::deprecationLog('The function \TYPO3\CMS\Core\Html\HtmlParser::XHTML_clean has been deprecated with TYPO3 CMS 7 and will be removed with CMS 8.');
-               $content = $this->HTMLcleaner($content, array(), 1, 0, array('xhtml' => 1));
-               return $content;
+               GeneralUtility::logDeprecatedFunction('TYPO3\CMS\Core\Html\HtmlParser::XHTML_clean has been deprecated with TYPO3 CMS 7 and will be removed with TYPO3 CMS 8.');
+               return $this->HTMLcleaner($content, array(), 1, 0, array('xhtml' => 1));
        }
 
        /**
index 48c721a..e29cd52 100644 (file)
@@ -3463,10 +3463,9 @@ class TypoScriptFrontendController {
         *
         * @return string Keyword: "all", "cached" or "output
         * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
-        *
         */
        public function doXHTML_cleaning() {
-               GeneralUtility::deprecationLog('The TypoScript option "config.xhtml_cleaning" has been deprecated with TYPO3 CMS 7 and will be removed with CMS 8.');
+               GeneralUtility::deprecationLog('The TypoScript option "config.xhtml_cleaning" has been deprecated with TYPO3 CMS 7 and will be removed with TYPO3 CMS 8.');
                return $this->config['config']['xhtml_cleaning'];
        }