From 58f4c2d442d765c103fa2bf4e62ca060f8da76c1 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 21 Sep 2014 20:38:06 +0200 Subject: [PATCH] Improved encoding of emails Closes #1566 --- com.woltlab.wcf/bbcode.xml | 4 +-- .../lib/system/bbcode/EmailBBCode.class.php | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php diff --git a/com.woltlab.wcf/bbcode.xml b/com.woltlab.wcf/bbcode.xml index 5d889f89ce..173cb543bb 100644 --- a/com.woltlab.wcf/bbcode.xml +++ b/com.woltlab.wcf/bbcode.xml @@ -32,12 +32,10 @@ all^sup - a - a + none^img,b,i,u,s,sub,sup,color,size,font - href="mailto:%s" 1 1 ^[^\s]+@[^\s]+$ diff --git a/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php new file mode 100644 index 0000000000..80c13cbf38 --- /dev/null +++ b/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php @@ -0,0 +1,28 @@ + + * @package com.woltlab.wcf + * @subpackage system.bbcode + * @category Community Framework + */ +class EmailBBCode extends AbstractBBCode { + /** + * @see \wcf\system\bbcode\IBBCode::getParsedTag() + */ + public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser) { + $email = ''; + if (isset($openingTag['attributes'][0])) { + $email = $openingTag['attributes'][0]; + } + $email = StringUtil::decodeHTML($email); + + return '' . $content . ''; + } +} -- 2.20.1