[BUGFIX] Do not call bidir_htmlspecialchars as static function 86/36886/4
authorAndreas Müller <a.mueller@secu-ring.de>
Fri, 13 Feb 2015 20:23:31 +0000 (20:23 +0000)
committerMarkus Klein <klein.t3@reelworx.at>
Sat, 14 Feb 2015 10:50:48 +0000 (11:50 +0100)
The static call of bidir_htmlspecialchars throws a notice.
Just refactored the code to use the class instance instead.

Resolves: #64827
Releases: master, 6.2
Change-Id: I384646ccb07c05e5db76100228f3bb61c2a07d93
Reviewed-on: http://review.typo3.org/36886
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php

index 3272152..5adaf6c 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\IndexedSearch\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Html\HtmlParser;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -582,8 +583,9 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
         * @return string Processed content
         */
        protected function markupSWpartsOfString($str) {
+               $htmlParser = GeneralUtility::makeInstance(HtmlParser::class);
                // Init:
-               $str = str_replace('&nbsp;', ' ', \TYPO3\CMS\Core\Html\HtmlParser::bidir_htmlspecialchars($str, -1));
+               $str = str_replace('&nbsp;', ' ', $htmlParser->bidir_htmlspecialchars($str, -1));
                $str = preg_replace('/\\s\\s+/', ' ', $str);
                $swForReg = array();
                // Prepare search words for regex:
index 1e3a681..1459e15 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\IndexedSearch\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Html\HtmlParser;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -1919,8 +1920,9 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         * @return string Processed content.
         */
        public function markupSWpartsOfString($str) {
+               $htmlParser = GeneralUtility::makeInstance(HtmlParser::class);
                // Init:
-               $str = str_replace('&nbsp;', ' ', \TYPO3\CMS\Core\Html\HtmlParser::bidir_htmlspecialchars($str, -1));
+               $str = str_replace('&nbsp;', ' ', $htmlParser->bidir_htmlspecialchars($str, -1));
                $str = preg_replace('/\\s\\s+/', ' ', $str);
                $swForReg = array();
                // Prepare search words for regex: