From eb634555dfd704da0f4c5385d8d8b7d8515cde85 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 11 Jan 2014 17:43:17 +0000 Subject: [PATCH] Exclude the dir ICEcoder is running from After globalling $docRoot and $ICEcodeDir, work out a $localPath for the file we have a result for If our results match, we are looking in the ICEcoder dir and should exclude as a result --- lib/multiple-results.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/multiple-results.php b/lib/multiple-results.php index ae25e3c..34f1b97 100644 --- a/lib/multiple-results.php +++ b/lib/multiple-results.php @@ -113,7 +113,7 @@ if (startTab!=top.ICEcoder.selectedTab) { $r = 0; function phpGrep($q, $path, $base) { $fp = opendir($path); - global $r, $ICEcoder, $serverType, $selectedFiles, $context; + global $r, $ICEcoder, $serverType, $selectedFiles, $docRoot, $ICEcoderDir, $context; if (!isset($ret)) {$ret="";}; $slash = $serverType == strpos($path,"\\")>-1 ? "\\" : "/"; while($f = readdir($fp)) { @@ -124,9 +124,15 @@ if (startTab!=top.ICEcoder.selectedTab) { } else if(stristr(toUTF8noBOM(file_get_contents($fullPath,false,$context),false), $q)) { $bFile = false; $foundInSelFile = false; + // Exclude banned files for ($i=0;$i