From b20b9a0b12fd4d6b745c28f72c24a13292adc4e4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 16 Jan 2020 16:10:34 +0100 Subject: [PATCH] Properly suppress links in the AttachmentBBCode when requested by the parser --- .../files/lib/system/bbcode/AttachmentBBCode.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php index b413afee00..37c534c916 100644 --- a/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php @@ -40,7 +40,11 @@ class AttachmentBBCode extends AbstractBBCode { } $hasParentLink = false; - if (!empty($closingTag['__parents'])) { + /** @var HtmlBBCodeParser $parser */ + if ($parser->getRemoveLinks()) { + $hasParentLink = true; + } + else if (!empty($closingTag['__parents'])) { /** @var \DOMElement $parent */ foreach ($closingTag['__parents'] as $parent) { if ($parent->nodeName === 'a') { -- 2.20.1