From 76db62dcb7170534a4aa6d95eb462af1d8b4e7cb Mon Sep 17 00:00:00 2001 From: ngleader Date: Wed, 29 Sep 2010 02:51:38 +0000 Subject: [PATCH] =?UTF-8?q?#19160528=20html=20attribute=EC=9D=98=20quotati?= =?UTF-8?q?on=20=EC=A0=90=EA=B2=80=20=EB=B6=80=EB=B6=84=20=EC=88=98?= =?UTF-8?q?=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@7735 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- config/func.inc.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/config/func.inc.php b/config/func.inc.php index 4a3ca6194..aca4c6120 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -705,15 +705,20 @@ **/ function fixQuotation($matches) { $key = $matches[1]; - $val = $matches[2]; + $val = trim($matches[2]); - if(substr($val,0,1)!='"'){ - if(substr($val,-1)=='/'){ - $val = '"'.substr($val,0,-1).'" /'; - }else{ - $val = '"'.$val.'"'; - } + $close_tag = false; + if(substr($val,-1)=='/') { + $close_tag = true; + $val = rtrim(substr($val,0,-1)); } + + if($val{0}=="'" && substr($val,-1)=="'") + { + $val = sprintf('"%s"', substr($val,1,-1)); + } + + if($close_tag) $val .= ' /'; // attribute on* remove if(preg_match('/^on(click|load|unload|blur|dbclick|focus|resize|keypress|keyup|keydown|mouseover|mouseout|mouseup|select|change|error)/',preg_replace('/[^a-zA-Z_]/','',$key))) return '';