public function filter($text, array $options = array()) {

        if (!isset($options['originalformat'])) {
            // if the format is not specified, we are probably called by {@see format_string()}
            // in that case, it would be dangerous to replace text with the image because it could
            // be stripped. therefore, we do nothing
            return $text;
        }
        if (in_array($options['originalformat'], explode(',', get_config('filter_emoticon', 'formats')))) {
            return $this->replace_emoticons($text);
        }
        return $text;
    }
public function filter($text, array $options = array()) {

        if (!isset($options['originalformat'])) {
            // if the format is not specified, we are probably called by {@see format_string()}
            // in that case, it would be dangerous to replace text with the image because it could
            // be stripped. therefore, we do nothing
            return $text;
        }
        if (in_array($options['originalformat'], explode(',', get_config('filter_emoticon', 'formats')))) {
            return $this->replace_emoticons($text);
        }
        return $text;
    }
public function filter ( $ text , array $ options = array ( ) ) { if ( ! isset ( $ options [ 'originalformat' ] ) ) { // if the format is not specified, we are probably called by {@see format_string()} // in that case, it would be dangerous to replace text with the image because it could // be stripped. therefore, we do nothing return $ text ; } if ( in_array ( $ options [ 'originalformat' ] , explode ( ',' , get_config ( 'filter_emoticon' , 'formats' ) ) ) ) { return $ this -> replace_emoticons ( $ text ) ; } return $ text ; }
Apply the filter to the text

@see filter_manager::apply_filter_chain()
@param string $text to be processed by the text
@param array $options filter options
@return string text after processing
Apply the filter to the text