<div class="warning">
<p><strong>{lang}wcf.page.offline{/lang}</strong></p>
- <p>{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|htmlspecialchars|nl2br}{/if}</p>
+ <p>{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|newlineToBreak}{/if}</p>
</div>
{include file='footer'}
{if OFFLINE && $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')}
<div class="warning">
<p><strong>{lang}wcf.page.offline{/lang}</strong></p>
- <p>{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|htmlspecialchars|nl2br}{/if}</p>
+ <p>{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|newlineToBreak}{/if}</p>
</div>
{/if}
--- /dev/null
+<?php
+namespace wcf\system\template\plugin;
+use wcf\system\template\TemplateEngine;
+use wcf\util\StringUtil;
+
+/**
+ * The 'newlineToBreak' modifier inserts HTML line breaks before all newlines.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2013 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.template.plugin
+ * @category Community Framework
+ */
+class NewlineToBreakModifierTemplatePlugin implements IModifierTemplatePlugin {
+ /**
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ */
+ public function execute($tagArgs, TemplateEngine $tplObj) {
+ return nl2br(StringUtil::encodeHTML($tagArgs[0]));
+ }
+}