From fabfcbd742e80234d021c3fda41415139d7e8e88 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Wed, 22 May 2013 13:00:19 +0100 Subject: [PATCH] Test against converted UTF8 no BOM content Convert content to UTF8 with no BOM before testing matches against it --- lib/multiple-results.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/multiple-results.php b/lib/multiple-results.php index 449929b..3d70c06 100644 --- a/lib/multiple-results.php +++ b/lib/multiple-results.php @@ -121,7 +121,7 @@ if (startTab!=top.ICEcoder.selectedTab) { $fullPath = $path.$slash.$f; if(is_dir($fullPath)) { $ret .= phpGrep($q, $fullPath, $base); - } else if(stristr(file_get_contents($fullPath), $q)) { + } else if(stristr(toUTF8noBOM(file_get_contents($fullPath),false), $q)) { $bFile = false; $foundInSelFile = false; for ($i=0;$i0 && $foundInSelFile)) { $ret .= ""; - $ret .= str_replace($base,"",$fullPath)."
Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times
"; + $ret .= str_replace($base,"",$fullPath)."
Found ".substr_count(strtolower(toUTF8noBOM(file_get_contents($fullPath),false)),$q)." times
"; if (isset($_GET['replace'])) { $ret .= "
replace
"; };