mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02: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:
@@ -60,8 +60,12 @@ class ucp_main
|
|||||||
// Determine first forum the user is able to read into - for global announcement link
|
// Determine first forum the user is able to read into - for global announcement link
|
||||||
$sql = 'SELECT forum_id
|
$sql = 'SELECT forum_id
|
||||||
FROM ' . FORUMS_TABLE . '
|
FROM ' . FORUMS_TABLE . '
|
||||||
WHERE forum_type = ' . FORUM_POST . '
|
WHERE forum_type = ' . FORUM_POST;
|
||||||
AND forum_id NOT IN (' . implode(', ', $forum_ary) . ')';
|
|
||||||
|
if (sizeof($forum_ary))
|
||||||
|
{
|
||||||
|
$sql .= ' AND forum_id NOT IN ( ' . implode(', ', $forum_ary) . ')';
|
||||||
|
}
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
$g_forum_id = (int) $db->sql_fetchfield('forum_id', 0, $result);
|
$g_forum_id = (int) $db->sql_fetchfield('forum_id', 0, $result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
Reference in New Issue
Block a user