From bd4391d4cac93a7e224230a8b8f8fe0b7c199043 Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 30 Aug 2006 00:52:14 +0000 Subject: [PATCH] - Bug #3978 git-svn-id: file:///svn/phpbb/trunk@6331 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_main.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 0dd69e4bcf..0bd49767a9 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -65,7 +65,7 @@ class ucp_main if (sizeof($forum_ary)) { - $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary); + $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true); } $result = $db->sql_query_limit($sql, 1); $g_forum_id = (int) $db->sql_fetchfield('forum_id'); @@ -79,12 +79,16 @@ class ucp_main $result = $db->sql_query($sql); $topic_list = $rowset = array(); - while ($row = $db->sql_fetchrow($result)) + // If the user can't see any forums, he can't read any posts because fid of 0 is invalid + if ($g_forum_id) { - $topic_list[] = $row['topic_id']; - $rowset[$row['topic_id']] = $row; + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + $rowset[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); } - $db->sql_freeresult($result); $topic_tracking_info = array(); if ($config['load_db_lastread'])