#19160528 html attribute의 quotation 점검 부분 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7735 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2010-09-29 02:51:38 +00:00
parent 3929b9a0c2
commit 76db62dcb7

View file

@ -705,15 +705,20 @@
**/ **/
function fixQuotation($matches) { function fixQuotation($matches) {
$key = $matches[1]; $key = $matches[1];
$val = $matches[2]; $val = trim($matches[2]);
if(substr($val,0,1)!='"'){ $close_tag = false;
if(substr($val,-1)=='/'){ if(substr($val,-1)=='/') {
$val = '"'.substr($val,0,-1).'" /'; $close_tag = true;
}else{ $val = rtrim(substr($val,0,-1));
$val = '"'.$val.'"';
}
} }
if($val{0}=="'" && substr($val,-1)=="'")
{
$val = sprintf('"%s"', substr($val,1,-1));
}
if($close_tag) $val .= ' /';
// attribute on* remove // 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 ''; 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 '';