From: Tim Düsterhus Date: Wed, 27 Nov 2013 14:20:28 +0000 (+0100) Subject: Fix highlighting of quotes in XML highlighter X-Git-Tag: 2.0.0_RC_4~4^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ecf558a18001d54e86c5fb464ed3a0756519d5ba;p=GitHub%2FWoltLab%2FWCF.git Fix highlighting of quotes in XML highlighter --- diff --git a/wcfsetup/install/files/lib/system/bbcode/highlighter/XmlHighlighter.class.php b/wcfsetup/install/files/lib/system/bbcode/highlighter/XmlHighlighter.class.php index 0a8ab5bb12..f016cf8881 100644 --- a/wcfsetup/install/files/lib/system/bbcode/highlighter/XmlHighlighter.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/highlighter/XmlHighlighter.class.php @@ -75,16 +75,23 @@ class XmlHighlighter extends Highlighter { * @see \wcf\system\bbcode\highlighter\Highlighter::cacheQuotes() */ protected function cacheQuotes($string) { + $string = parent::cacheQuotes($string); + // highlight CDATA-Tags as quotes $string = Regex::compile('', Regex::DOT_ALL)->replace($string, new Callback(function (array $matches) { return StringStack::pushToStringStack(''.StringUtil::encodeHTML($matches[0]).'', 'highlighterQuotes'); })); - $string = parent::cacheQuotes($string); - return $string; } + /** + * @see \wcf\system\bbcode\highlighter\Highlighter::highlightQuotes() + */ + protected function highlightQuotes($string) { + return StringStack::reinsertStrings(parent::highlightQuotes($string), 'highlighterQuotes'); + } + /** * @see \wcf\system\bbcode\highlighter\Highlighter::highlightNumbers() */