|
92 | 92 | const spansArray = parent.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
93 | 93 | for (let i = 0; i < spansArray.length; i++) {
|
94 | 94 | let foundInSelected = false;
|
| 95 | + const targetURLElem = spansArray[i]; |
95 | 96 | const targetURL = spansArray[i].id.replace(/\|/g, "/").toLowerCase();
|
96 | 97 | const targetURLDisplay = spansArray[i].id.replace(/\|/g, "/"); // Original filename incl casing
|
97 | 98 | const targetName = targetURL.substring(targetURL.lastIndexOf("/") + 1);
|
|
118 | 119 | }
|
119 | 120 | }
|
120 | 121 | if (-1 < userTarget.indexOf("all") || (-1 < userTarget.indexOf("selected") && foundInSelected)) {
|
| 122 | + // Skip displaying directories |
| 123 | + if (-1 < targetURLElem.parentNode.parentNode.className.indexOf('pft-directory')) { |
| 124 | + continue; |
| 125 | + } |
121 | 126 | resultsDisplay +=
|
122 | 127 | '<a href="javascript:parent.ICEcoder.openFile(\'<?php echo $docRoot;?>' +
|
123 | 128 | targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g,"") +
|
@@ -165,15 +170,15 @@ function phpGrep($q, $path, $base) {
|
165 | 170 | } else if(stristr(toUTF8noBOM(getData($fullPath), false), $q)) {
|
166 | 171 | $bFile = false;
|
167 | 172 | $foundInSelFile = false;
|
168 |
| - // Exclude banned files |
| 173 | + // Exclude banned dirs/files (string in path name) |
169 | 174 | for ($i = 0; $i < count($ICEcoder['bannedFiles']); $i++) {
|
170 |
| - if (false !== strpos($f, str_replace("*", "", $ICEcoder['bannedFiles'][$i]))) { |
| 175 | + if (false !== strpos($fullPath, str_replace("*", "", $ICEcoder['bannedFiles'][$i]))) { |
171 | 176 | $bFile = true;
|
172 | 177 | };
|
173 | 178 | }
|
174 |
| - // Exclude the dirs & files we wish to exclude from find & replace tasks |
| 179 | + // Exclude the dirs/files we wish to exclude from find & replace tasks (string in path name) |
175 | 180 | for ($i = 0; $i < count($ICEcoder['findFilesExclude']); $i++) {
|
176 |
| - if (false !== strpos($f, str_replace("*", "", $ICEcoder['findFilesExclude'][$i]))) { |
| 181 | + if (false !== strpos($fullpath, str_replace("*", "", $ICEcoder['findFilesExclude'][$i]))) { |
177 | 182 | $bFile = true;
|
178 | 183 | };
|
179 | 184 | }
|
@@ -203,6 +208,7 @@ function phpGrep($q, $path, $base) {
|
203 | 208 | }
|
204 | 209 | }
|
205 | 210 | }
|
| 211 | + closedir($fp); |
206 | 212 | return $ret;
|
207 | 213 | }
|
208 | 214 |
|
|
0 commit comments