diff --git a/phpBB/search.php b/phpBB/search.php index ddacb8d2ea6..904857a7fd4 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -418,7 +418,7 @@ if ($sort_key == 'a') { $sort_join = USERS_TABLE . ' u, '; - $sql_sort = ' AND u.user_id = t.topic_last_poster_id ' . $sql_sort; + $sql_sort = ' AND u.user_id = ' . ($show_results == 'posts' ? 'p.poster_id' : 't.topic_last_poster_id ') . $sql_sort; } if ($show_results == 'posts') {