/** * Creates the right output, depending on $truncSize, $syndicateHtml properties. * @return string the formatted field */ function output() { // when field available and syndicated in html we assume // - valid html in $rawFieldContent and we enclose in CDATA tags // - no truncation (truncating risks producing invalid html) if (!$this->rawFieldContent) { $result = ""; } elseif ($this->syndicateHtml) { $result = "<![CDATA[" . $this->rawFieldContent . "]]>"; } else { if ($this->truncSize and is_int($this->truncSize)) { $result = FeedCreator::static_htmlspecialchars(FeedCreator::iTrunc($this->rawFieldContent, $this->truncSize), $this->encoding); } else { $result = FeedCreator::static_htmlspecialchars($this->rawFieldContent, $this->encoding); } } return $result; }