Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit dfb4025

Browse files
author
mattpass
committed
Fix clickable filenames, don't show perms
1 parent fe7c03d commit dfb4025

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lib/multiple-results.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@
9393
for (let i = 0; i < spansArray.length; i++) {
9494
let foundInSelected = false;
9595
const targetURL = spansArray[i].id.replace(/\|/g, "/").toLowerCase();
96+
const targetURLDisplay = spansArray[i].id.replace(/\|/g, "/"); // Original filename incl casing
9697
const targetName = targetURL.substring(targetURL.lastIndexOf("/") + 1);
9798
let haveMatch = false;
9899
while ((match = rExp.exec(targetName)) !== null) {
99-
console.log(match);
100100
haveMatch = true;
101101
}
102102
if (
@@ -120,23 +120,20 @@
120120
if (-1 < userTarget.indexOf("all") || (-1 < userTarget.indexOf("selected") && foundInSelected)) {
121121
resultsDisplay +=
122122
'<a href="javascript:parent.ICEcoder.openFile(\'<?php echo $docRoot;?>' +
123-
targetURL.replace(/\|/g, "/").replace(/_perms/g,"") +
123+
targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g,"") +
124124
'\');parent.ICEcoder.goFindAfterOpenInt = setInterval(function(){goFindAfterOpen(\'<?php echo $docRoot;?>' +
125-
targetURL.replace(/\|/g, "/").replace(/_perms/g, "") +
125+
targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g, "") +
126126
'\')}, 20);parent.ICEcoder.showHide(\'hide\', parent.document.getElementById(\'blackMask\'))">';
127127
// TODO: get this line working
128128
resultsDisplay +=
129-
targetURL.replace(/\|/g, "/").replace(/_perms/g, "").replace(/<?php
129+
targetURLDisplay.replace(/\|/g, "/").replace(/_perms/g, "").replace(/<?php
130130
echo str_replace("/", "\/",strtolower(preg_quote($findText))); ?>/g, "<b>" +
131131
parent.ICEcoder.xssClean(findText).toLowerCase() + "</b>");
132132
resultsDisplay += '</a><br>';
133-
<?php if (false === isset($_GET['replace'])) { ?>
134-
resultsDisplay += '<div id="foundCount' + i +'">' + spansArray[i].innerHTML + '</div>';
135-
<?php ;} else { ?>
136-
// TODO: get this line working
133+
<?php if (true === isset($_GET['replace'])) { ?>
137134
resultsDisplay +=
138-
'<div id="foundCount' + i + '">' + spansArray[i].innerHTML +
139-
', <?php echo $t['rename to'];?> ' +
135+
'<div id="foundCount' + i + '">' +
136+
'<?php echo $t['rename to'];?> ' +
140137
targetURL.replace(/\|/g, "/").replace(/_perms/g, "").replace(/<?php echo str_replace("/", "\/",strtolower(preg_quote($findText))); ?>/g,"<b><?php
141138
if (isset($_GET['replace'])) {echo str_replace("&amp;", "&", xssClean($_GET['replace'], 'script'));};
142139
?></b>")+'</div>';

0 commit comments

Comments
 (0)