diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 84cfda6595..c119677992 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -109,11 +109,11 @@
  • [Fix] Use memcache::replace() instead of memcache::set() for existing keys to prevent problems.
  • [Fix] Check for required functions in eAccelerator. (Bug #54465)
  • [Fix] Use correct RFC 3339 date format in ATOM feed. (Bug #55005)
  • +
  • [Fix] Do not deliver topics from unreadable or passworded forums in the news feed. (Bug #54345)
  • [Change] Log activation through inactive users ACP. (Bug #30145)
  • [Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)
  • [Change] Use em dash instead of hyphen/minus as separator in ATOM Feeds item statistics. (Bug #53565)
  • [Change] Cache overall, forums, topics and news feeds for anonymous users and bots.
  • -
  • [Change] Do not deliver topics from unreadable forums in the news feed. (Bug #54345)
  • 1.ii. Changes since 3.0.5

    diff --git a/phpBB/feed.php b/phpBB/feed.php index 98e8e61349..26bfbb0d51 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -545,6 +545,16 @@ class phpbb_feed_base } $db->sql_freeresult($result); + // Include passworded forums + $this->excluded_forums_ary = array_unique(array_merge($this->excluded_forums_ary, $this->get_passworded_forums())); + + return $this->excluded_forums_ary; + } + + function get_passworded_forums() + { + global $db, $user; + // Exclude passworded forums $sql = 'SELECT f.forum_id, fa.user_id FROM ' . FORUMS_TABLE . ' f @@ -554,16 +564,19 @@ class phpbb_feed_base WHERE f.forum_password <> ''"; $result = $db->sql_query($sql); + $forum_ids = array(); while ($row = $db->sql_fetchrow($result)) { + $forum_id = (int) $row['forum_id']; + if ($row['user_id'] != $user->data['user_id']) { - $this->excluded_forums_ary[(int) $row['forum_id']] = (int) $row['forum_id']; + $forum_ids[$forum_id] = $forum_id; } } $db->sql_freeresult($result); - return $this->excluded_forums_ary; + return $forum_ids; } function get_item() @@ -960,6 +973,9 @@ class phpbb_feed_news extends phpbb_feed_base { global $auth, $config, $db; + // Get passworded forums + $forum_ids_passworded = $this->get_passworded_forums(); + // Get news forums... $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' @@ -969,8 +985,16 @@ class phpbb_feed_news extends phpbb_feed_base $in_fid_ary = array(); while ($row = $db->sql_fetchrow($result)) { + $forum_id = (int) $row['forum_id']; + + // Passworded forum + if (isset($forum_ids_passworded[$forum_id])) + { + continue; + } + // Make sure we can read this forum - if (!$auth->acl_get('f_read', (int) $row['forum_id'])) + if (!$auth->acl_get('f_read', $forum_id)) { continue; }