From 0a198f82f57cf70ac1075b4a35035131a8397932 Mon Sep 17 00:00:00 2001 From: nichogenius Date: Wed, 26 Jul 2017 05:00:04 -0600 Subject: [PATCH] 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. --- scan.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scan.php b/scan.php index e86eecb..dc9c142 100644 --- a/scan.php +++ b/scan.php @@ -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; }