[ticket/17422] Fix author_id search results sorting

PHPBB-17422
This commit is contained in:
rxu 2024-10-30 21:22:37 +07:00
parent 725cbd31c8
commit be52902541
No known key found for this signature in database
GPG key ID: 955F0567380E586A

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;