From: Alexander Ebert Date: Sun, 6 Nov 2016 08:51:29 +0000 (+0100) Subject: Resetting internal states and avoid memory issues X-Git-Tag: 3.0.0_Beta_5~68 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b59d49a1c2e11c7aef52bcfcccf558c50534abd;p=GitHub%2FWoltLab%2FWCF.git Resetting internal states and avoid memory issues --- diff --git a/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php index 2daf141d14..10719fbbc7 100644 --- a/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/HtmlInputProcessor.class.php @@ -42,6 +42,8 @@ class HtmlInputProcessor extends AbstractHtmlProcessor { * @param boolean $convertFromBBCode interpret input as bbcode */ public function process($html, $objectType, $objectID = 0, $convertFromBBCode = false) { + $this->reset(); + $this->setContext($objectType, $objectID); // enforce consistent newlines @@ -161,6 +163,14 @@ class HtmlInputProcessor extends AbstractHtmlProcessor { $this->context['objectID'] = $objectID; } + /** + * Resets internal states and discards references to objects. + */ + protected function reset() { + $this->embeddedContent = []; + $this->htmlInputNodeProcessor = null; + } + /** * @return IHtmlInputFilter */