Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 36eb5ee

Browse files
committed
Make sure to filter search results with access driver hidden configurations.
1 parent 16577ae commit 36eb5ee

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

core/src/plugins/core.access/class.AbstractAccessDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ public function filterUserSelectionToHidden($files)
550550
public function filterNodeName($nodePath, $nodeName, &$isLeaf, $lsOptions)
551551
{
552552
$showHiddenFiles = $this->getFilteredOption("SHOW_HIDDEN_FILES", $this->repository->getId());
553-
$isLeaf = (is_file($nodePath."/".$nodeName) || AJXP_Utils::isBrowsableArchive($nodeName));
553+
if($isLeaf === ""){
554+
$isLeaf = (is_file($nodePath."/".$nodeName) || AJXP_Utils::isBrowsableArchive($nodeName));
555+
}
554556
if (AJXP_Utils::isHidden($nodeName) && !$showHiddenFiles) {
555557
return false;
556558
}

core/src/plugins/core.notifications/class.AJXP_NotificationCenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function loadUserFeed($actionName, $httpVars, $fileVars)
202202
continue;
203203
}
204204
try {
205-
$node->loadNodeInfo();
205+
@$node->loadNodeInfo();
206206
} catch (Exception $e) {
207207
continue;
208208
}

core/src/plugins/index.lucene/class.AjxpLuceneIndexer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ public function applyAction($actionName, $httpVars, $fileVars)
212212
if (!is_readable($tmpNode->getUrl())){
213213
continue;
214214
}
215+
$basename = basename($tmpNode->getPath());
216+
if (!$this->accessDriver->filterNodeName($tmpNode->getPath(), $basename, $tmpNode->isLeaf(), array("d" => true, "f" => true))){
217+
continue;
218+
}
215219
$tmpNode->search_score = sprintf("%0.2f", $hit->score);
216220
if (isSet($returnNodes)) {
217221
$returnNodes[] = $tmpNode;
@@ -286,6 +290,10 @@ public function applyAction($actionName, $httpVars, $fileVars)
286290
if (!is_readable($tmpNode->getUrl())){
287291
continue;
288292
}
293+
$basename = basename($tmpNode->getPath());
294+
if (!$this->accessDriver->filterNodeName($tmpNode->getPath(), $basename, $tmpNode->isLeaf(), array("d"=>true, "f"=>true))){
295+
continue;
296+
}
289297
$tmpNode->search_score = sprintf("%0.2f", $hit->score);
290298
if (isSet($returnNodes)) {
291299
$returnNodes[] = $tmpNode;

0 commit comments

Comments
 (0)