/** * Prepares text for display * * Should be used after retrieving data from the database * * @author Matthew McNaney <mcnaney at gmail dot com> * @param string text Text to parse * @param boolean decode Whether entity_decoding should take place. * @param boolean use_filters If true, any filters requested in the text_settings file will be * run against the output text. (deprecated) * @return string text Stripped text */ public static function parseOutput($text, $decode = ENCODE_PARSED_TEXT, $use_filters = false, $use_breaker = USE_BREAKER, $fix_anchors = FIX_ANCHORS) { $t = new PHPWS_Text(); $t->setText($text, $decode); $t->useBreaker($use_breaker); $t->useAnchor($fix_anchors); $text = $t->getPrint(); $text = filter_var($text, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH); return $text; }
public function getSummaryAndEntry($fix_anchors = true) { if (!empty($this->entry)) { $content = $this->summary . '<hr />' . $this->entry; //return PHPWS_Text::parseOutput($this->summary) . '<hr />' . PHPWS_Text::parseOutput($this->entry); } else { $content = $this->summary; //return PHPWS_Text::parseOutput($this->summary); } $text = new PHPWS_Text($content); $text->useAnchor($fix_anchors); return filter_var($text->getPrint(), FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH); }