- Affected version
- 2.2.10 Patch 1
\XF\Search\Searcher::search
calls \XF\Search\Search::executeSearch
will load the results, and puts it into a \XF\ResultSet
to-do visibility checks, and then returns an array. Then the call to \XF\ResultSet::limitResults()
will do that same again, loading the data and doing another view check.This also applies to the main search, but since this is hidden behind a redirect it isn't immediately obvious.
PHP:
protected function executeSearch(
Query\Query $query,
$maxResults,
\Closure $resultBuilder,
$applyVisitorPermissions = true
)
{
...
$resultSet = $this->getResultSet($results)->limitResults($maxResults, $applyVisitorPermissions);
return $resultSet->getResults();
}
public function actionRecentContent(ParameterBag $params)
{
...
$resultSet = $searcher->getResultSet($searcher->search($query));
$resultSet->limitResults(15);
I think the best fix would be for
\XF\Search\Search::getResultSetData
to check the entity cache for each id before invoking the search content type handler
Last edited: