diff --git a/lib/multiple-results.php b/lib/multiple-results.php
index d23998d..1029d59 100644
--- a/lib/multiple-results.php
+++ b/lib/multiple-results.php
@@ -101,7 +101,6 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
haveMatch = true;
}
if (
- // TODO: Find in filenames not working with regex, see all instances of findText and $findText below
true === haveMatch && -1 < targetURL.indexOf('_perms')) {
if (-1 < userTarget.indexOf("selected")) {
for (let j = 0; j < parent.ICEcoder.selectedFiles.length; j++) {
@@ -123,23 +122,25 @@ if (true === isset($_GET['target']) && false !== strpos($_GET['target'], "filena
if (-1 < targetURLElem.parentNode.parentNode.className.indexOf('pft-directory')) {
continue;
}
+ const tidiedFileName = targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g, "");
resultsDisplay +=
'' +
- targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g, "") +
+ tidiedFileName +
'\')}, 20);parent.ICEcoder.showHide(\'hide\', parent.document.getElementById(\'blackMask\'))">';
- // TODO: get this line working
- resultsDisplay +=
- targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g, "").replace(//g, "" +
- parent.ICEcoder.xssClean(findText).toLowerCase() + "");
- resultsDisplay += '
';
+
+
+ // Highlight our matches in filename via single regex () capturing group to use with $1
+ const re = /()/gi;
+ resultsDisplay += tidiedFileName.replace(re, '$1') + '
';
+
+ // If replacing in filename
resultsDisplay +=
'