From 8488381f60c5c0efb7d2c820857514e09cafee6c Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 22 Jul 2013 15:47:56 +0200 Subject: [PATCH] Fixed encoding issues --- com.woltlab.wcf/templates/offline.tpl | 2 +- com.woltlab.wcf/templates/userNotice.tpl | 2 +- ...ineToBreakModifierTemplatePlugin.class.php | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 wcfsetup/install/files/lib/system/template/plugin/NewlineToBreakModifierTemplatePlugin.class.php diff --git a/com.woltlab.wcf/templates/offline.tpl b/com.woltlab.wcf/templates/offline.tpl index 8c317e3c1f..1fcd65077e 100644 --- a/com.woltlab.wcf/templates/offline.tpl +++ b/com.woltlab.wcf/templates/offline.tpl @@ -12,7 +12,7 @@

{lang}wcf.page.offline{/lang}

-

{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|htmlspecialchars|nl2br}{/if}

+

{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|newlineToBreak}{/if}

{include file='footer'} diff --git a/com.woltlab.wcf/templates/userNotice.tpl b/com.woltlab.wcf/templates/userNotice.tpl index 2e4e9ac9f0..9f6dfb80df 100644 --- a/com.woltlab.wcf/templates/userNotice.tpl +++ b/com.woltlab.wcf/templates/userNotice.tpl @@ -2,7 +2,7 @@ {if OFFLINE && $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')}

{lang}wcf.page.offline{/lang}

-

{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|htmlspecialchars|nl2br}{/if}

+

{if OFFLINE_MESSAGE_ALLOW_HTML}{@OFFLINE_MESSAGE|language}{else}{@OFFLINE_MESSAGE|language|newlineToBreak}{/if}

{/if} diff --git a/wcfsetup/install/files/lib/system/template/plugin/NewlineToBreakModifierTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/NewlineToBreakModifierTemplatePlugin.class.php new file mode 100644 index 0000000000..f5e82fb6d0 --- /dev/null +++ b/wcfsetup/install/files/lib/system/template/plugin/NewlineToBreakModifierTemplatePlugin.class.php @@ -0,0 +1,23 @@ + + * @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])); + } +} -- 2.20.1