mirror of
https://github.com/scr34m/php-malware-scanner.git
synced 2026-06-16 12:30:35 +00:00
using strpos instead of substr_count
don't know if it's faster, but I don't see a reason to count the number of times a line exists in a file for our use case.
This commit is contained in:
3
scan.php
3
scan.php
@@ -173,8 +173,7 @@ class MalwareScanner
|
|||||||
if ($toSearch[0] === '#') {
|
if ($toSearch[0] === '#') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$substrCount = substr_count($fileContent, $toSearch);
|
if (strpos($fileContent, $toSearch) !== FALSE){
|
||||||
if ($substrCount > 0) {
|
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user