From: Alexander Ebert Date: Wed, 16 Nov 2016 14:30:50 +0000 (+0100) Subject: Strip dummy paragraphs X-Git-Tag: 3.0.0_Beta_5~45 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=728f8c7d123a34f1126ea9e0436683f2de7edadf;p=GitHub%2FWoltLab%2FWCF.git Strip dummy paragraphs --- 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 55d4880fc0..34bb064d41 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 @@ -239,6 +239,14 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor { } } + // strip empty

(zero content, not even whitespaces) + $paragraphs = DOMUtil::getElements($this->getDocument(), 'p'); + foreach ($paragraphs as $paragraph) { + if ($paragraph->childNodes->length === 0) { + DOMUtil::removeNode($paragraph); + } + } + // trim

...

/** @var \DOMElement $paragraph */ foreach ($this->getDocument()->getElementsByTagName('p') as $paragraph) {