$options[] = [
'isMessage' => $object->isMessage(),
'title' => $object->getLocalizedName($defaultLanguage),
- 'value' => $object->getFormattedOptionValue(true)
+ 'value' => $object->getFormattedOptionValue(true),
+ 'htmlValue' => $object->getFormattedOptionValue(),
];
}
case 'radioButton':
case 'select':
$selectOptions = OptionUtil::parseSelectOptions($this->selectOptions);
- if (isset($selectOptions[$this->optionValue])) return WCF::getLanguage()->get($selectOptions[$this->optionValue]);
+ if (isset($selectOptions[$this->optionValue])) return WCF::getLanguage()->get(($forcePlaintext ? $selectOptions[$this->optionValue] : StringUtil::encodeHTML($selectOptions[$this->optionValue])));
return '';
case 'multiSelect':
$result = '';
foreach ($values as $value) {
if (isset($selectOptions[$value])) {
- if (!empty($result)) $result .= "<br>\n";
- $result .= WCF::getLanguage()->get($selectOptions[$value]);
+ if (!empty($result)) {
+ if ($forcePlaintext) $result .= "\n";
+ else $result .= "<br>";
+ }
+ $result .= WCF::getLanguage()->get(($forcePlaintext ? $selectOptions[$value] : StringUtil::encodeHTML($selectOptions[$value])));
}
}
return $result;
// fallthrough
default:
- return StringUtil::encodeHTML($this->optionValue);
+ if (!$forcePlaintext) return StringUtil::encodeHTML($this->optionValue);
+ return $this->optionValue;
}
}
<p><br></p>
<p>E-Mail-Adresse: <a href="mailto:{$emailAddress}">{$emailAddress}</a></p>
{foreach from=$options item=option}
-<p><strong>{@$option['title']}:</strong> {if !$option['isMessage']}{@$option['value']}{else}
-{@$option['value']|newlineToBreak}{/if}</p>
+<p><strong>{@$option['title']}:</strong> {@$option['htmlValue']}</p>
{/foreach}]]></item>
<item name="wcf.contact.option1"><![CDATA[Betreff]]></item>
<item name="wcf.contact.optionDescription1"><![CDATA[Kurze, prägnante Beschreibung der Anfrage.]]></item>
<p><br></p>
<p>Email: <a href="mailto:{$emailAddress}">{$emailAddress}</a></p>
{foreach from=$options item=option}
-<p><strong>{@$option['title']}:</strong> {if !$option['isMessage']}{@$option['value']}{else}
-{@$option['value']|newlineToBreak}{/if}</p>
+<p><strong>{@$option['title']}:</strong> {@$option['htmlValue']}</p>
{/foreach}]]></item>
<item name="wcf.contact.option1"><![CDATA[Subject]]></item>
<item name="wcf.contact.optionDescription1"><![CDATA[Short and precise description of your inquiry.]]></item>