From: Marcel Werk Date: Thu, 6 Feb 2020 17:42:56 +0000 (+0100) Subject: Fixed missing consideration of the removeLinks parameter in bbcodes X-Git-Tag: 5.2.2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b7d2c487be7cb7364074d48e7c39626a2ea05e4a;p=GitHub%2FWoltLab%2FWCF.git Fixed missing consideration of the removeLinks parameter in bbcodes --- diff --git a/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php index 7eb66696fe..348616502a 100644 --- a/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php @@ -21,6 +21,12 @@ class EmailBBCode extends AbstractBBCode { } $email = StringUtil::decodeHTML($email); - return '' . StringUtil::encodeHTML($email) . ''; + /** @var HtmlBBCodeParser $parser */ + if ($parser->getRemoveLinks()) { + return StringUtil::encodeHTML($email); + } + else { + return '' . StringUtil::encodeHTML($email) . ''; + } } } diff --git a/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php index 2ecc56dd93..c5e71e94b1 100644 --- a/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php @@ -18,6 +18,7 @@ class MediaBBCode extends AbstractBBCode { public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser) { $content = StringUtil::trim($openingTag['attributes'][0]); + /** @var HtmlBBCodeParser $parser */ if ($parser->getOutputType() == 'text/html') { foreach (BBCodeMediaProvider::getCache() as $provider) { if ($provider->matches($content)) { @@ -25,7 +26,7 @@ class MediaBBCode extends AbstractBBCode { } } } - else if ($parser->getOutputType() == 'text/simplified-html') { + else if ($parser->getOutputType() == 'text/simplified-html' && !$parser->getRemoveLinks()) { foreach (BBCodeMediaProvider::getCache() as $provider) { if ($provider->matches($content)) { return StringUtil::getAnchorTag($content);