Properly suppress links in the AttachmentBBCode when requested by the parser
authorAlexander Ebert <ebert@woltlab.com>
Thu, 16 Jan 2020 15:10:34 +0000 (16:10 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 16 Jan 2020 15:10:34 +0000 (16:10 +0100)
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php

index b413afee003170d231c85983bd1179160afff08d..37c534c91647be9779ca6c24878ff47e93c92ec1 100644 (file)
@@ -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') {