From be529025414722da3bd0c7bd14c152f043184570 Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 30 Oct 2024 21:22:37 +0700 Subject: [PATCH] [ticket/17422] Fix author_id search results sorting PHPBB-17422 --- phpBB/phpbb/search/base.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php index e7d0774b6c..e33dfc8f75 100644 --- a/phpBB/phpbb/search/base.php +++ b/phpBB/phpbb/search/base.php @@ -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;