From: Alexander Ebert Date: Fri, 7 Oct 2016 08:32:50 +0000 (+0200) Subject: Prevent processing of removed nodes X-Git-Tag: 3.0.0_Beta_3~50^2~68 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=01da1e30868c464d0fe0bb8eedb3d994784ecd4a;p=GitHub%2FWoltLab%2FWCF.git Prevent processing of removed nodes --- 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); }