From c925e8ef586cbb28ee0f430a41b5f9723dc51de5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 24 May 2021 16:20:13 +0200 Subject: [PATCH] [ticket/16138] Use same variable for forum_id in one query PHPBB3-16138 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 87fcf1c2fd..5ad75d6170 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -146,7 +146,7 @@ if ($view && !$post_id) WHERE forum_id = ' . $forum_id . " AND topic_moved_id = 0 AND topic_last_post_time $sql_condition {$row['topic_last_post_time']} - AND " . $phpbb_content_visibility->get_visibility_sql('topic', $row['forum_id']) . " + AND " . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id) . " ORDER BY topic_last_post_time $sql_ordering, topic_last_post_id $sql_ordering"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result);