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;