mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix #2077 don't check hwpx files as XML
This commit is contained in:
parent
3e83a472cc
commit
29bf72c998
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue