mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/10885] Fix UCP Main Error if no forums exist
This error is caused by an empty set passed to sql_in_set if the user cannot read any forums PHPBB3-10885
This commit is contained in:
parent
17681c0770
commit
a2dd99b75e
1 changed files with 8 additions and 9 deletions
|
@ -69,17 +69,16 @@ class ucp_main
|
||||||
// Get cleaned up list... return only those forums having the f_read permission
|
// Get cleaned up list... return only those forums having the f_read permission
|
||||||
$forum_ary = $auth->acl_getf('f_read', true);
|
$forum_ary = $auth->acl_getf('f_read', true);
|
||||||
$forum_ary = array_unique(array_keys($forum_ary));
|
$forum_ary = array_unique(array_keys($forum_ary));
|
||||||
|
|
||||||
$sql = "SELECT t.* $sql_select
|
|
||||||
FROM $sql_from
|
|
||||||
WHERE t.topic_type = " . POST_GLOBAL . '
|
|
||||||
AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . '
|
|
||||||
ORDER BY t.topic_last_post_time DESC';
|
|
||||||
|
|
||||||
$topic_list = $rowset = array();
|
$topic_list = $rowset = array();
|
||||||
|
|
||||||
// If the user can't see any forums, he can't read any posts because fid of 0 is invalid
|
// If the user can't see any forums, he can't read any posts because fid of 0 is invalid
|
||||||
if (!empty($forum_ary))
|
if (!empty($forum_ary))
|
||||||
{
|
{
|
||||||
|
$sql = "SELECT t.* $sql_select
|
||||||
|
FROM $sql_from
|
||||||
|
WHERE t.topic_type = " . POST_GLOBAL . '
|
||||||
|
AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . '
|
||||||
|
ORDER BY t.topic_last_post_time DESC';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
|
Loading…
Add table
Reference in a new issue