From 01da1e30868c464d0fe0bb8eedb3d994784ecd4a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 7 Oct 2016 10:32:50 +0200 Subject: [PATCH] Prevent processing of removed nodes --- .../system/html/node/AbstractHtmlNodeProcessor.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php index bda5953294..9fd0f2ffd0 100644 --- a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php @@ -83,11 +83,12 @@ abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor { $html = preg_replace('~^~', '', $html); $html = preg_replace('~$~', '', $html); - /** @var IHtmlNode $obj */ foreach ($this->nodeData as $data) { - $obj = $data['object']; - $string = $obj->replaceTag($data['data']); - $html = preg_replace_callback('~(?P[\s\S]*)~', function($matches) use ($string) { + $html = preg_replace_callback('~(?P[\s\S]*)~', function($matches) use ($data) { + /** @var IHtmlNode $obj */ + $obj = $data['object']; + $string = $obj->replaceTag($data['data']); + if (mb_strpos($string, '') !== false) { return str_replace('', $matches['content'], $string); } -- 2.20.1