Strip empty link artifacts in the output
authorAlexander Ebert <ebert@woltlab.com>
Fri, 15 Dec 2023 14:08:33 +0000 (15:08 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 15 Dec 2023 14:08:33 +0000 (15:08 +0100)
See https://www.woltlab.com/community/thread/303588/

wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeA.class.php

index 77b432994145d9fa385a4bbd2b4de2e31aba3ac5..6821427059d87ccf7d0b3a5e87154477889e0c37 100644 (file)
@@ -59,7 +59,11 @@ class HtmlOutputNodeA extends AbstractHtmlOutputNode
             $value = StringUtil::trim($element->textContent);
             if ($value === '') {
                 if ($element->childElementCount === 0) {
-                    $value = $href->__toString();
+                    // Discard empty links, these were sometimes created by the
+                    // previous editor when editing links.
+                    DOMUtil::removeNode($element);
+
+                    continue;
                 }
             } else if ($this->isSuspiciousValue($value, $href)) {
                 $value = $href->__toString();