mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
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
This commit is contained in:
parent
9187d51a4b
commit
df3faf5e20
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue