-
Bug
-
Resolution: Fixed
-
Blocker
-
3.1.0-dev
-
None
The following code results in an error if forum_ary is empty, since sql_in_set does not allow empty arrays by default.
Instead $db->sql_in_set('t.forum_id', $forum_ary, false, true) can be used to simply return no results on empty array, which makes it work. Or the query could be skipped entirely if no forums were found. One should probably also review the rest of that code to make sure it handles an empty forum list correctly.
// Get cleaned up list... return only those forums having the f_read permission
|
$forum_ary = $auth->acl_getf('f_read', true);
|
$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';
|
- was caused by solution of
-
PHPBB-9684 Link global announcements to forums
- Unverified Fix