From d659e16f778314cc0157863453ea5f083d62f430 Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 6 Dec 2010 23:56:13 +0000 Subject: [PATCH] =?UTF-8?q?=ED=85=9C=ED=94=8C=EB=A6=BF=20=EB=AC=B8?= =?UTF-8?q?=EB=B2=95=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7956 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/template/TemplateHandler.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index edc6aae97..b17597cc3 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -154,12 +154,12 @@ // loop 템플릿 문법을 변환 $buff = $this->_replaceLoop($buff); - // |cond 템플릿 문법을 변환 - $buff = preg_replace_callback("/<\/?(\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i", array($this, '_replacePipeCond'), $buff); - // cond 템플릿 문법을 변환 $buff = $this->_replaceCond($buff); + // |cond 템플릿 문법을 변환 + $buff = preg_replace_callback("/<\/?(\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i", array($this, '_replacePipeCond'), $buff); + // include 태그의 변환 $buff = preg_replace_callback('!]+)>!is', array($this, '_replaceInclude'), $buff); @@ -332,9 +332,11 @@ **/ function _replacePipeCond($matches) { - while(strpos($matches[0],'|cond="')!==false) { - if(preg_match('/ (\w+)=\"([^\"]+)\"\|cond=\"([^\"]+)\"/is', $matches[0], $m)) - $matches[0] = str_replace($m[0], sprintf(' %s="%s"', $m[3], $m[1], $m[2]), $matches[0]); + if(strpos($matches[0],'|cond')!==false) { + while(strpos($matches[0],'|cond="')!==false) { + if(preg_match('/ (\w+)=\"([^\"]+)\"\|cond=\"([^\"]+)\"/is', $matches[0], $m)) + $matches[0] = str_replace($m[0], sprintf(' %s="%s"', $m[3], $m[1], $m[2]), $matches[0]); + } } return $matches[0];