Do not discard the element value if there are children
authorAlexander Ebert <ebert@woltlab.com>
Tue, 3 Oct 2023 13:15:03 +0000 (15:15 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 3 Oct 2023 13:15:03 +0000 (15:15 +0200)
See https://www.woltlab.com/community/thread/301825-bild-wird-nicht-angezeigt/

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

index 55e7b99d664a5fb8e4644b06ea9fa721bad22b53..0ccf682ed4b923938fd1f968a8c2fe3e3d915438 100644 (file)
@@ -57,8 +57,11 @@ class HtmlOutputNodeA extends AbstractHtmlOutputNode
             }
 
             $value = StringUtil::trim($element->textContent);
-
-            if ($value === '' || $this->isSuspiciousValue($value, $href)) {
+            if ($value === '') {
+                if ($element->childElementCount === 0) {
+                    $value = $href->__toString();
+                }
+            } else if ($this->isSuspiciousValue($value, $href)) {
                 $value = $href->__toString();
             }