From 980318953e67146a5f674c443186d2227096f18b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 18 Jul 2022 12:31:11 +0200 Subject: [PATCH] Revert "Replace use of a PHP 8+ feature" The minimum version is PHP 8.1 for this branch. This reverts commit c70a77e262ed65c0d92cc3ecb0e1cb1967d5b74d. --- .../input/node/HtmlInputNodeProcessor.class.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index c672bebdbd..9385bea52d 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@ -319,18 +319,7 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor if ($depth === 0 && $isFullQuote && \count($quotes) > 0) { /** @var \DOMElement $body */ $body = $this->getDocument()->getElementsByTagName('body')[0]; - - // TODO: This can be simplified in PHP 8.0+ by checking against `$body->childElementCount`. - $hasChildren = false; - /** @var \DOMNode $node */ - foreach ($body->childNodes as $node) { - if ($node->nodeType === \XML_ELEMENT_NODE) { - $hasChildren = true; - break; - } - } - - if (!$hasChildren) { + if ($body->childElementCount === 0) { $p = $body->ownerDocument->createElement('p'); $p->textContent = "[\u{2026}]"; $body->appendChild($p); -- 2.20.1