issue 534: remove XSS code

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9661 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-10-17 06:23:59 +00:00
parent b49fbf4da1
commit 6ee154c21b
2 changed files with 8 additions and 2 deletions

View file

@ -660,7 +660,7 @@
* Remove codes to abuse the admin session in src by tags of imaages and video postings
* - Issue reported by Sangwon Kim
**/
$content = preg_replace_callback('@<(/?)([a-z]+[0-9]?)([^>]*?\b(?:on[a-z]+|data|style|background|href|(?:dyn|low)?src)\s*=[\s\S]*?)(/?)>@i', 'removeSrcHack', $content);
$content = preg_replace_callback('@<(/?)([a-z]+[0-9]?)((?>"[^"]*"|\'[^\']*\'|[^>])*?\b(?:on[a-z]+|data|style|background|href|(?:dyn|low)?src)\s*=[\s\S]*?)(/?)>@i', 'removeSrcHack', $content);
// xmp tag 확인 및 추가
$content = checkXmpTag($content);
@ -710,6 +710,7 @@
$attr = array();
foreach($attrs as $name=>$val) {
$val = str_replace('"', '&quot;', $val);
$attr[] = $name."=\"{$val}\"";
}
$attr = count($attr)?' '.implode(' ',$attr):'';