From df3faf5e207e960722cc3b45de5d22108135382c Mon Sep 17 00:00:00 2001 From: Tom Beddard Date: Sat, 7 Jan 2006 01:07:07 +0000 Subject: [PATCH] Fix for SQL error when the $forum_ary array is empty when there are no global announcements to view git-svn-id: file:///svn/phpbb/trunk@5435 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_main.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 8bc98adb3d..8b92ae30b9 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -60,8 +60,12 @@ class ucp_main // Determine first forum the user is able to read into - for global announcement link $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' - WHERE forum_type = ' . FORUM_POST . ' - AND forum_id NOT IN (' . implode(', ', $forum_ary) . ')'; + WHERE forum_type = ' . FORUM_POST; + + if (sizeof($forum_ary)) + { + $sql .= ' AND forum_id NOT IN ( ' . implode(', ', $forum_ary) . ')'; + } $result = $db->sql_query_limit($sql, 1); $g_forum_id = (int) $db->sql_fetchfield('forum_id', 0, $result); $db->sql_freeresult($result);