From: Marcel Werk Date: Sun, 21 Sep 2014 18:38:06 +0000 (+0200) Subject: Improved encoding of emails X-Git-Tag: 2.1.0_Alpha_1~303^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=58f4c2d442d765c103fa2bf4e62ca060f8da76c1;p=GitHub%2FWoltLab%2FWCF.git Improved encoding of emails Closes #1566 --- 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 . ''; + } +}