From 76ccb5ff89a7099ef8d3bced5d951962725c7204 Mon Sep 17 00:00:00 2001 From: Abdullah Almsaeed Date: Mon, 11 Dec 2017 15:51:21 -0500 Subject: [PATCH] Make sure to index nodes only if they are accessible to anonymous users --- includes/Jobs/NodesIndexJob.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/Jobs/NodesIndexJob.php b/includes/Jobs/NodesIndexJob.php index 85c2af4b..72d2a1cd 100644 --- a/includes/Jobs/NodesIndexJob.php +++ b/includes/Jobs/NodesIndexJob.php @@ -87,8 +87,15 @@ protected function loadContent($records) { if (!isset($nodes[$record->nid])) { continue; } + $node = $nodes[$record->nid]; + if(!node_access('view', $node)) { + // Anonymous user is not allowed to access this node + // so don't index it + continue; + } + $modules = module_implements('node_view'); foreach ($modules as $module) { module_invoke($module, 'node_view', $node, 'full', NULL);