Skip mailto links
authorCyperghost <olaf_schmitz_1@t-online.de>
Wed, 20 Dec 2023 13:33:12 +0000 (14:33 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Wed, 20 Dec 2023 13:33:12 +0000 (14:33 +0100)
wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeA.class.php

index 6821427059d87ccf7d0b3a5e87154477889e0c37..97212a649ad45bac32486f78ea7a59b7e0839a34 100644 (file)
@@ -44,16 +44,18 @@ class HtmlOutputNodeA extends AbstractHtmlOutputNode
                 continue;
             }
 
-            if (ApplicationHandler::getInstance()->isInternalURL($href->__toString())) {
-                $href = $href->withScheme(RouteHandler::secureConnection() ? 'https' : 'http');
-
-                $element->setAttribute(
-                    'href',
-                    $href->__toString(),
-                );
-            } else {
-                /** @var HtmlOutputNodeProcessor $htmlNodeProcessor */
-                self::markLinkAsExternal($element, $htmlNodeProcessor->getHtmlProcessor()->enableUgc);
+            if ($href->getScheme() !== 'mailto') {
+                if (ApplicationHandler::getInstance()->isInternalURL($href->__toString())) {
+                    $href = $href->withScheme(RouteHandler::secureConnection() ? 'https' : 'http');
+
+                    $element->setAttribute(
+                        'href',
+                        $href->__toString(),
+                    );
+                } else {
+                    /** @var HtmlOutputNodeProcessor $htmlNodeProcessor */
+                    self::markLinkAsExternal($element, $htmlNodeProcessor->getHtmlProcessor()->enableUgc);
+                }
             }
 
             $value = StringUtil::trim($element->textContent);