mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Disable useless UploadFileFilter
This commit is contained in:
parent
e405fc69ac
commit
4594c40321
1 changed files with 1 additions and 32 deletions
|
|
@ -3,40 +3,9 @@
|
||||||
|
|
||||||
class UploadFileFilter
|
class UploadFileFilter
|
||||||
{
|
{
|
||||||
private static $_block_list = array ('exec', 'system', 'passthru', 'show_source', 'phpinfo', 'fopen', 'file_get_contents', 'file_put_contents', 'fwrite', 'proc_open', 'popen');
|
|
||||||
|
|
||||||
public function check($file)
|
public function check($file)
|
||||||
{
|
{
|
||||||
// TODO: 기능개선후 enable
|
return true;
|
||||||
|
|
||||||
return TRUE; // disable
|
|
||||||
if (! $file || ! FileHandler::exists($file)) return TRUE;
|
|
||||||
return self::_check ( $file );
|
|
||||||
}
|
|
||||||
|
|
||||||
private function _check($file)
|
|
||||||
{
|
|
||||||
if (! ($fp = fopen ( $file, 'r' ))) return FALSE;
|
|
||||||
|
|
||||||
$has_php_tag = FALSE;
|
|
||||||
|
|
||||||
while ( ! feof ( $fp ) )
|
|
||||||
{
|
|
||||||
$content = fread ( $fp, 8192 );
|
|
||||||
if (FALSE === $has_php_tag) $has_php_tag = strpos ( $content, '<?' );
|
|
||||||
foreach ( self::$_block_list as $v )
|
|
||||||
{
|
|
||||||
if (FALSE !== $has_php_tag && FALSE !== strpos ( $content, $v ))
|
|
||||||
{
|
|
||||||
fclose ( $fp );
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose ( $fp );
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue