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:
nichogenius
2017-07-26 05:00:04 -06:00
committed by GitHub
parent 1c7963149e
commit 0a198f82f5

View File

@@ -173,8 +173,7 @@ class MalwareScanner
if ($toSearch[0] === '#') {
continue;
}
$substrCount = substr_count($fileContent, $toSearch);
if ($substrCount > 0) {
if (strpos($fileContent, $toSearch) !== FALSE){
$found = true;
break;
}