Prevent unfurling urls during worker actions
authorjoshuaruesweg <ruesweg@woltlab.com>
Fri, 5 Mar 2021 10:50:46 +0000 (11:50 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Tue, 16 Mar 2021 15:19:14 +0000 (16:19 +0100)
wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php

index b0a715355be132438306a1f783f8931ae00ecfba..379b47936d9249f072a81e1ebca54c9265d36ffc 100644 (file)
@@ -8,6 +8,7 @@ use wcf\system\html\node\AbstractHtmlNodeProcessor;
 use wcf\system\html\node\HtmlNodePlainLink;
 use wcf\system\html\node\HtmlNodeUnfurlLink;
 use wcf\system\html\node\IHtmlNode;
+use wcf\system\worker\AbstractWorker;
 use wcf\util\DOMUtil;
 use wcf\util\StringUtil;
 
@@ -744,9 +745,12 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor
 
         EventHandler::getInstance()->fireAction($this, 'convertPlainLinks');
 
-        foreach ($this->plainLinks as $plainLink) {
-            if ($plainLink->isPristine()) {
-                HtmlNodeUnfurlLink::setUnfurl($plainLink);
+        $isWorkerAction = \class_exists(AbstractWorker::class, false);
+        if (!$isWorkerAction) {
+            foreach ($this->plainLinks as $plainLink) {
+                if ($plainLink->isPristine()) {
+                    HtmlNodeUnfurlLink::setUnfurl($plainLink);
+                }
             }
         }
     }