From a8e9c58d7aeaed1e90dfa54caa6ee650908b40d3 Mon Sep 17 00:00:00 2001 From: conory Date: Thu, 22 Mar 2018 16:34:19 +0900 Subject: [PATCH] =?UTF-8?q?inline=20=ED=85=9C=ED=94=8C=EB=A6=BF=20?= =?UTF-8?q?=EB=AC=B8=EB=B2=95=20=EC=9D=B8=EC=8B=9D=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20https://github.com/rhymix/rhymix/commit/a6?= =?UTF-8?q?e9222facf634a40de6840cfb37fa90920194f3=20=EB=B3=B4=EC=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 잘못 인식된 문법 ex) '|escape}" />

c">abc

123
--- classes/template/TemplateHandler.class.php | 23 +++++----------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index a22945e2b..a226eeb86 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -419,26 +419,13 @@ class TemplateHandler */ private function _parseInline($buff) { - if(!preg_match_all('/<([a-zA-Z]+\d?)(?:\s)/', $buff, $match)) - { - return $buff; - } - - $tags = array_diff(array_unique($match[1]), $this->skipTags); - - if(!count($tags)) - { - return $buff; - } - - $tags = '(?:' . implode('|', $tags) . ')'; - $split_regex = "@(<(?>/?{$tags})(?>[^<>\{\}\"']+||{[^}]+}|\".*?\"|'.*?'|.)*?>)@s"; - - $nodes = preg_split($split_regex, $buff, -1, PREG_SPLIT_DELIM_CAPTURE); - // list of self closing tags $self_closing = array('area' => 1, 'base' => 1, 'basefont' => 1, 'br' => 1, 'hr' => 1, 'input' => 1, 'img' => 1, 'link' => 1, 'meta' => 1, 'param' => 1, 'frame' => 1, 'col' => 1); - + + $skip = $this->skipTags ? sprintf('(?!%s)', implode('|', $this->skipTags)) : ''; + $split_regex = "@([^<>{}\"]+|.*?|{[^}]*}|\"(?>'.*?'|.)*?\"|.)*?>)@s"; + $nodes = preg_split($split_regex, $buff, -1, PREG_SPLIT_DELIM_CAPTURE); + for($idx = 1, $node_len = count($nodes); $idx < $node_len; $idx+=2) { if(!($node = $nodes[$idx]))