/** * Apply filters to the text element * * @param string $text * @param string $postMode * @return string */ private function _applyTextFilter($text, $postMode) { $text = GLText::remove4byteUtf8Chars($text); if ($this->_text_version == GLTEXT_FIRST_VERSION) { // first version // Remove any autotags the user doesn't have permission to use $text = PLG_replaceTags($text, '', true); $text = COM_checkWords($text, 'story'); if (in_array($postMode, array('html', 'adveditor', 'wikitext'))) { // html or wikitext $text = GLText::checkHTML($text, 'story.edit'); } else { // plaintext $text = COM_makeClickableLinks(htmlspecialchars($text)); } } else { // latest version // Now not do anything here to hold the raw text. // And do all of the text processing just before display. } return $text; }
/** * This function checks html tags. * * Checks to see that the HTML tags are on the approved list and * removes them if not. * * @param string $str HTML to check * @param string $permissions comma-separated list of rights which identify the current user as an "Admin" * @return string Filtered HTML * */ function COM_checkHTML($str, $permissions = 'story.edit') { global $_CONF; require_once $_CONF['path_system'] . 'classes/gltext.class.php'; return GLText::checkHTML($str, $permissions); }
/** * This function checks html tags. * Checks to see that the HTML tags are on the approved list and * removes them if not. * * @param string $str HTML to check * @param string $permissions comma-separated list of rights which identify the current user as an "Admin" * @return string Filtered HTML */ function COM_checkHTML($str, $permissions = 'story.edit') { return GLText::checkHTML($str, $permissions); }