diff --git a/common/framework/filters/FileContentFilter.php b/common/framework/filters/FileContentFilter.php index 690171bb2..986e6f208 100644 --- a/common/framework/filters/FileContentFilter.php +++ b/common/framework/filters/FileContentFilter.php @@ -41,6 +41,7 @@ class FileContentFilter $fp = fopen($file, 'rb'); $first4kb = fread($fp, 4096); $is_xml = preg_match('/<(?:\?xml|!DOCTYPE|html|head|body|meta|script|svg)\b/i', $first4kb); + $skip_xml = preg_match('/^(hwpx)$/', $ext); // Check SVG files. if (($ext === 'svg' || $is_xml) && !self::_checkSVG($fp, 0, $filesize)) @@ -71,7 +72,7 @@ class FileContentFilter } // Check HTML files. - if (($ext === 'html' || $ext === 'shtml' || $ext === 'xhtml' || $ext === 'phtml' || $is_xml) && !self::_checkHTML($fp, 0, $filesize)) + if (($ext === 'html' || $ext === 'shtml' || $ext === 'xhtml' || $ext === 'phtml' || ($is_xml && !$skip_xml)) && !self::_checkHTML($fp, 0, $filesize)) { fclose($fp); return false;