From: Marcel Werk Date: Fri, 15 Jul 2016 12:00:49 +0000 (+0200) Subject: Do cleanup before adding a message to search index X-Git-Tag: 3.0.0_Beta_1~1124 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=70028940618292d6153a1f696d42015d83f191ac;p=GitHub%2FWoltLab%2FWCF.git Do cleanup before adding a message to search index --- diff --git a/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php b/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php index d1fba77883..c1714b98cc 100644 --- a/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php @@ -7,6 +7,7 @@ use wcf\data\package\PackageList; use wcf\system\exception\SystemException; use wcf\system\search\mysql\MysqlSearchIndexManager; use wcf\system\SingletonFactory; +use wcf\util\StringUtil; /** * Manages the search index. @@ -103,6 +104,9 @@ class SearchIndexManager extends SingletonFactory implements ISearchIndexManager * @inheritDoc */ public function set($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID = null, $metaData = '') { + // strip html; remove whitespace from beginning and end of the message + $message = StringUtil::trim(StringUtil::stripHTML($message)); + $this->getSearchIndexManager()->set($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData); }