`DOMElement::$childElementCount` is supported in PHP 8.0+ only, for PHP 7 we need to manually check for child elements.
See https://www.woltlab.com/community/thread/296485-zitat-von-user-nochmal-zitieren/
if ($depth === 0 && $isFullQuote && \count($quotes) > 0) {
/** @var \DOMElement $body */
$body = $this->getDocument()->getElementsByTagName('body')[0];
- if ($body->childElementCount === 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) {
$p = $body->ownerDocument->createElement('p');
$p->textContent = "[\u{2026}]";
$body->appendChild($p);