$options[] = [
'isMessage' => $object->isMessage(),
'title' => $object->getLocalizedName($defaultLanguage),
- 'value' => $object->getFormattedOptionValue()
+ 'value' => $object->getFormattedOptionValue(true)
];
}
/**
* Returns the formatted value of this option.
- *
+ *
+ * @param boolean $forcePlaintext
* @return string
*/
- public function getFormattedOptionValue() {
+ public function getFormattedOptionValue($forcePlaintext = false) {
switch ($this->optionType) {
case 'boolean':
return WCF::getLanguage()->get('wcf.acp.customOption.optionType.boolean.'.($this->optionValue ? 'yes' : 'no'));
}
}
return $result;
-
+
+ /** @noinspection PhpMissingBreakStatementInspection */
case 'textarea':
- return SimpleMessageParser::getInstance()->parse($this->optionValue);
-
+ if (!$forcePlaintext) return SimpleMessageParser::getInstance()->parse($this->optionValue);
+ // fallthrough
+
+ /** @noinspection PhpMissingBreakStatementInspection */
case 'message':
- return MessageParser::getInstance()->parse($this->optionValue);
-
+ if (!$forcePlaintext) return MessageParser::getInstance()->parse($this->optionValue);
+ // fallthrough
+
+ /** @noinspection PhpMissingBreakStatementInspection */
case 'URL':
- return StringUtil::getAnchorTag($this->optionValue);
+ if (!$forcePlaintext) return StringUtil::getAnchorTag($this->optionValue);
+ // fallthrough
default:
return StringUtil::encodeHTML($this->optionValue);