mirror of
https://github.com/scr34m/php-malware-scanner.git
synced 2026-06-16 12:30:35 +00:00
Case insensitive extension check, removed problematic whitelist
This commit is contained in:
4
scan.php
4
scan.php
@@ -46,7 +46,7 @@ class MalwareScanner
|
||||
if ($ext[0] != '.') {
|
||||
$ext = '.' . $ext;
|
||||
}
|
||||
$this->extension = $ext;
|
||||
$this->extension = strtolower($ext);
|
||||
}
|
||||
if (isset($options['hide-ok'])) {
|
||||
$this->flagHideOk = true;
|
||||
@@ -116,7 +116,7 @@ class MalwareScanner
|
||||
if (is_dir($dir . $file)) {
|
||||
$this->process($dir . $file . '/');
|
||||
} elseif (is_file($dir . $file)) {
|
||||
$ext = substr($file, strrpos($file, '.'));
|
||||
$ext = strtolower(substr($file, strrpos($file, '.')));
|
||||
if ($ext == $this->extension) {
|
||||
$this->scan($dir . $file);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user