/** * Get offensive words from database. * @return an array which contains sensitve words */ private function getOffensiveWords() { if (empty(self::$offensiveWords)) { $rowSet = Option::findFirst("option_key = 'OffensiveWords'"); if ($rowSet != NULL) { self::$offensiveWords = json_decode($rowSet->getOptionValue()); } } return self::$offensiveWords; }
/** * Get content without offensive words. * @param String $content - the content need to be filtered * @return the content without offensive words */ protected function getFilteredContent($content) { $offensiveWordPlugin = new OffensiveWordPlugin(); return $offensiveWordPlugin->getFilteredContent($content); }