1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge pull request #6745 from rxu/ticket/17422-master

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

View File

@@ -112,17 +112,10 @@ abstract class base implements search_backend_interface
}
}
// change the start to the actual end of the current request if the sort direction differs
// from the direction 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 self::SEARCH_RESULT_NOT_IN_CACHE;
}
$stored_ids = array_reverse($stored_ids);
}
for ($i = $start, $n = $start + $per_page; ($i < $n) && ($i < $result_count); $i++)
@@ -138,11 +131,6 @@ abstract class base implements search_backend_interface
}
unset($stored_ids);
if ($reverse_ids)
{
$id_ary = array_reverse($id_ary);
}
if (!$complete)
{
return self::SEARCH_RESULT_INCOMPLETE;