else {
$htmlOutputProcessor = new HtmlOutputProcessor();
$htmlOutputProcessor->setOutputType('text/plain');
- $htmlOutputProcessor->setUgc(false);
+ $htmlOutputProcessor->enableUgc = false;
$htmlOutputProcessor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID, false, $this->languageID);
return nl2br(StringUtil::encodeHTML(StringUtil::truncate($htmlOutputProcessor->getHtml(), 500)), false);
*/
public function getFormattedContent() {
$processor = new HtmlOutputProcessor();
- $processor->setUgc(false);
+ $processor->enableUgc = false;
$processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID, false, $this->languageID);
return $processor->getHtml();
*/
public function getAmpFormattedContent() {
$processor = new AmpHtmlOutputProcessor();
- $processor->setUgc(false);
+ $processor->enableUgc = false;
$processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID);
return $processor->getHtml();
case 'text/plain':
$processor = new HtmlOutputProcessor();
$processor->setOutputType('text/plain');
- $processor->setUgc(false);
+ $processor->enableUgc = false;
$processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID);
return $processor->getHtml();
// parse and return message
$processor = new HtmlOutputProcessor();
$processor->setOutputType('text/simplified-html');
- $processor->setUgc(false);
+ $processor->enableUgc = false;
$processor->process($this->content, 'com.woltlab.wcf.article.content', $this->articleContentID);
return $processor->getHtml();
* enables rel=ugc for external links
* @var bool
*/
- protected $ugc = true;
+ public $enableUgc = true;
/**
* Processes the input html string.
return $this->htmlOutputNodeProcessor;
}
-
- /**
- * Enables rel=ugc for external links.
- *
- * @param bool $enable
- */
- public function setUgc($enable = true) {
- $this->ugc = $enable;
- }
-
- /**
- * Returns true, if content is user-generated.
- *
- * @return bool
- */
- public function isUgc() {
- return $this->ugc;
- }
}
// proxy is enabled for insecure connections only
if (!IMAGE_ALLOW_EXTERNAL_SOURCE && !$this->isAllowedOrigin($src)) {
/** @var HtmlOutputNodeProcessor $htmlNodeProcessor */
- $this->replaceExternalSource($element, $src, $htmlNodeProcessor->getHtmlProcessor()->isUgc());
+ $this->replaceExternalSource($element, $src, $htmlNodeProcessor->getHtmlProcessor()->enableUgc);
}
continue;
}
else if (!IMAGE_ALLOW_EXTERNAL_SOURCE && !$this->isAllowedOrigin($src)) {
/** @var HtmlOutputNodeProcessor $htmlNodeProcessor */
- $this->replaceExternalSource($element, $src, $htmlNodeProcessor->getHtmlProcessor()->isUgc());
+ $this->replaceExternalSource($element, $src, $htmlNodeProcessor->getHtmlProcessor()->enableUgc);
}
else if (MESSAGE_FORCE_SECURE_IMAGES && Url::parse($src)['scheme'] === 'http') {
// rewrite protocol to `https`