1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

Merge pull request #6744 from rxu/ticket/17422

[ticket/17422] Fix search results sorting - 3.3.x
This commit is contained in:
Marc Alexander
2024-11-24 20:00:39 +01:00
3 changed files with 41 additions and 18 deletions

View File

@@ -76,17 +76,10 @@ class base
}
}
// change the start to the actual end of the current request if the sort direction differs
// from the dirction in the cache and reverse the ids later
// If the sort direction differs from the direction in the cache, then reverse the ids array
if ($reverse_ids)
{
$start = $result_count - $start - $per_page;
// the user requested a page past the last index
if ($start < 0)
{
return SEARCH_RESULT_NOT_IN_CACHE;
}
$stored_ids = array_reverse($stored_ids);
}
for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
@@ -102,11 +95,6 @@ class base
}
unset($stored_ids);
if ($reverse_ids)
{
$id_ary = array_reverse($id_ary);
}
if (!$complete)
{
return SEARCH_RESULT_INCOMPLETE;