bbcodes return an encoded marker
authorAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 20:50:50 +0000 (22:50 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 24 Aug 2016 20:50:56 +0000 (22:50 +0200)
wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php

index 94884bd4c9632af6fe83832662104f257bb8c54e..b2d70057ce712b6fdc972f29528c27aeebc31960 100644 (file)
@@ -81,7 +81,12 @@ abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor {
                        $obj = $data['object'];
                        $string = $obj->replaceTag($data['data']);
                        $html = preg_replace_callback('~<wcfNode-' . $data['identifier'] . '>(?P<content>[\s\S]*)</wcfNode-' . $data['identifier'] . '>~', function($matches) use ($string) {
-                               $string = str_replace('<!-- META_CODE_INNER_CONTENT -->', $matches['content'], $string);
+                               if (mb_strpos($string, '<!-- META_CODE_INNER_CONTENT -->') !== false) {
+                                       return str_replace('<!-- META_CODE_INNER_CONTENT -->', $matches['content'], $string);
+                               }
+                               else if (mb_strpos($string, '&lt;!-- META_CODE_INNER_CONTENT --&gt;') !== false) {
+                                       return str_replace('&lt;!-- META_CODE_INNER_CONTENT --&gt;', $matches['content'], $string);
+                               }
                                
                                return $string;
                        }, $html);