From 7f991e848042fe43849d4e2e31bbf9c7ff3afce3 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 5 Mar 2010 18:51:30 +0100 Subject: Fix Bug #58595 - ATOM Feed exposes forum content under some circumstances. --- phpBB/feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index 1832efbc61..a42aa42a7f 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -522,7 +522,7 @@ class phpbb_feed_base if (!isset($forum_ids)) { - $forum_ids = array_keys($auth->acl_getf('f_read')); + $forum_ids = array_keys($auth->acl_getf('f_read', true)); } return $forum_ids; -- cgit v1.2.1 From 2b696cc632b917c4d49330966ddb1dee639a22fe Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 1 Apr 2010 13:11:18 +0200 Subject: [bug/9108] Fix table binding issues with PostgreSQL in board-wide feed. (Old Bug #58425) The order in the FROM clause is important. The posts table has to be the last one in the chain, so it can be correctly bound with the forums table in the LEFT JOIN. This only affects the overall feed (board-wide feed). All the other feeds are unaffected. --- phpBB/feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index a42aa42a7f..4ce983a967 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -783,8 +783,8 @@ class phpbb_feed_overall extends phpbb_feed_post_base 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( - POSTS_TABLE => 'p', USERS_TABLE => 'u', + POSTS_TABLE => 'p', ), 'LEFT_JOIN' => array( array( -- cgit v1.2.1 From 8d0c0dcbcd890871f5b057afb8abb7fce0465b2f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 8 Mar 2010 00:02:46 +0100 Subject: [bug/58695] Only show unapproved posts in ATOM Feeds for moderators (Bug #58695) --- phpBB/feed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index a42aa42a7f..e0365462a0 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -535,7 +535,7 @@ class phpbb_feed_base if (!isset($forum_ids)) { - $forum_ids = array_keys($auth->acl_getf('m_approve')); + $forum_ids = array_keys($auth->acl_getf('m_approve', true)); } return $forum_ids; @@ -994,7 +994,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base if (!$this->topic_data['topic_approved']) { // Also require m_approve - $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve'))); + $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve', true))); if (empty($in_fid_ary)) { -- cgit v1.2.1 From 0d4daeb615ed35dc4ded54dd2034df6317837a77 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 8 Mar 2010 11:56:20 +0100 Subject: [bug/58695] Use method to get forums where user is moderator, thanks to bantu for the hint --- phpBB/feed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index e0365462a0..d52d3e6c8b 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -994,7 +994,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base if (!$this->topic_data['topic_approved']) { // Also require m_approve - $in_fid_ary = array_intersect($in_fid_ary, array_keys($auth->acl_getf('m_approve', true))); + $in_fid_ary = array_intersect($in_fid_ary, $this->get_moderator_approve_forums()); if (empty($in_fid_ary)) { -- cgit v1.2.1 From 46f85329da850bd9ed3c4b83c708683bbf0dcb91 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 Mar 2010 19:27:32 +0100 Subject: [feature/unapproved-posts-in-feed] View note for moderators on unapproved posts/topics with unapproved posts in ATOM Feed --- phpBB/feed.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index a42aa42a7f..575e937330 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -541,6 +541,19 @@ class phpbb_feed_base return $forum_ids; } + function is_moderator_approve_forum($forum_id) + { + $forum_ids = $this->get_moderator_approve_forums(); + + if (!$forum_id) + { + // Global announcement, your a moderator in any forum than it's okay. + return (sizeof($forum_ids) > 0) ? true : false; + } + + return (in_array($forum_id, $forum_ids)) ? true : false; + } + function get_excluded_forums() { global $db, $cache; @@ -677,7 +690,8 @@ class phpbb_feed_post_base extends phpbb_feed_base if ($config['feed_item_statistics']) { $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) - . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time']); + . ' ' . $this->separator_stats . ' ' . $user->format_date($row['post_time']) + . (($this->is_moderator_approve_forum($row['forum_id']) && !$row['post_approved']) ? ' ' . $this->separator_stats . ' ' . $user->lang['POST_UNAPPROVED'] : ''); } } } @@ -719,8 +733,9 @@ class phpbb_feed_topic_base extends phpbb_feed_base { $item_row['statistics'] = $user->lang['POSTED'] . ' ' . $user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row) . ' ' . $this->separator_stats . ' ' . $user->format_date($row[$this->get('date')]) - . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . $row['topic_replies'] - . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views']; + . ' ' . $this->separator_stats . ' ' . $user->lang['REPLIES'] . ' ' . (($this->is_moderator_approve_forum($row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies']) + . ' ' . $this->separator_stats . ' ' . $user->lang['VIEWS'] . ' ' . $row['topic_views'] + . (($this->is_moderator_approve_forum($row['forum_id']) && ($row['topic_replies_real'] != $row['topic_replies'])) ? ' ' . $this->separator_stats . ' ' . $user->lang['POSTS_UNAPPROVED'] : ''); } } } @@ -780,7 +795,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base // Get the actual data $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, ' . - 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . + 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( POSTS_TABLE => 'p', @@ -912,7 +927,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base } $this->sql = array( - 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . + 'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( POSTS_TABLE => 'p', @@ -1077,7 +1092,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base global $auth, $db; $this->sql = array( - 'SELECT' => 'p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . + 'SELECT' => 'p.post_id, p.post_time, p.post_approved, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' . 'u.username, u.user_id', 'FROM' => array( POSTS_TABLE => 'p', @@ -1241,7 +1256,7 @@ class phpbb_feed_news extends phpbb_feed_topic_base $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, - t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time, + t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time, p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( TOPICS_TABLE => 't', @@ -1314,7 +1329,7 @@ class phpbb_feed_topics extends phpbb_feed_topic_base $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, - t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_views, t.topic_time, + t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_time, p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( TOPICS_TABLE => 't', @@ -1412,7 +1427,7 @@ class phpbb_feed_topics_active extends phpbb_feed_topic_base $this->sql = array( 'SELECT' => 'f.forum_id, f.forum_name, - t.topic_id, t.topic_title, t.topic_replies, t.topic_views, + t.topic_id, t.topic_title, t.topic_replies, t.topic_replies_real, t.topic_views, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time, p.post_id, p.post_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url', 'FROM' => array( -- cgit v1.2.1 From 9b596faa3976fb17c13eb4c8d604c9e388f47209 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 10 Mar 2010 01:37:35 +0100 Subject: [feature/unapproved-posts-in-feed] Increase performance of is_moderator_approve_forum() as per bantu --- phpBB/feed.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index 575e937330..4eb70c76c8 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -543,15 +543,20 @@ class phpbb_feed_base function is_moderator_approve_forum($forum_id) { - $forum_ids = $this->get_moderator_approve_forums(); + static $forum_ids; + + if (!isset($forum_ids)) + { + $forum_ids = array_flip($this->get_moderator_approve_forums()); + } if (!$forum_id) { // Global announcement, your a moderator in any forum than it's okay. - return (sizeof($forum_ids) > 0) ? true : false; + return (!empty($forum_ids)) ? true : false; } - return (in_array($forum_id, $forum_ids)) ? true : false; + return (isset($forum_ids[$forum_id])) ? true : false; } function get_excluded_forums() -- cgit v1.2.1 From 16c95b4f8394e65faa34380640c892b1f99be1ed Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Sun, 18 Jul 2010 11:51:13 -0500 Subject: [ticket/9727] Smiley Path replacement in feeds is too generic The smiley path replacement in the feeds was too broad: any post content containing "./" was changed to the fully qualified board URL. This broke CSS for example. PHPBB3-9727 --- phpBB/feed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/feed.php') diff --git a/phpBB/feed.php b/phpBB/feed.php index 88c30c5d4f..c4b71f3a26 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -276,8 +276,8 @@ function feed_generate_content($content, $uid, $bitfield, $options) // Add newlines $content = str_replace('
', '
' . "\n", $content); - // Relative Path to Absolute path, Windows style - $content = str_replace('./', $board_url . '/', $content); + // Convert smiley Relative paths to Absolute path, Windows style + $content = str_replace($phpbb_root_path . $config['smilies_path'], $board_url . '/' . $config['smilies_path'], $content); // Remove "Select all" link and mouse events $content = str_replace('' . $user->lang['SELECT_ALL_CODE'] . '', '', $content); -- cgit v1.2.1