diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-05-06 21:50:42 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-05-06 21:50:42 +0200 |
commit | 6d40d437eb748f72a713dfc75e7ae7c7d8705b27 (patch) | |
tree | b9ddd4fef5340dbe62fc5fa18bef27592328fb81 /phpBB | |
parent | 0d4a7d76f4a0bbc87c29a0b3a504ae1f4c38c457 (diff) | |
parent | 62b4e7b9d25a8e947d2bec67888ad006f0f1b4b0 (diff) | |
download | forums-6d40d437eb748f72a713dfc75e7ae7c7d8705b27.tar forums-6d40d437eb748f72a713dfc75e7ae7c7d8705b27.tar.gz forums-6d40d437eb748f72a713dfc75e7ae7c7d8705b27.tar.bz2 forums-6d40d437eb748f72a713dfc75e7ae7c7d8705b27.tar.xz forums-6d40d437eb748f72a713dfc75e7ae7c7d8705b27.zip |
Merge pull request #2330 from Nicofuma/ticket/12421
[ticket/12421] Don't parse [attachment] tags if user can't view them
* Nicofuma/ticket/12421:
[ticket/12421] Rebase and enable tests
[ticket/12421] Don't parse [attachment] tags if user can't view them
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/feed.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/feed/forum.php | 1 | ||||
-rw-r--r-- | phpBB/phpbb/feed/topic.php | 7 |
3 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php index 0c4cc32fdb..db0ed5364e 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -100,6 +100,8 @@ while ($row = $feed->get_item()) $published = ($feed->get('published') !== NULL) ? (int) $row[$feed->get('published')] : 0; $updated = ($feed->get('updated') !== NULL) ? (int) $row[$feed->get('updated')] : 0; + $display_attachments = ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && isset($row['post_attachment']) && $row['post_attachment']) ? true : false; + $item_row = array( 'author' => ($feed->get('creator') !== NULL) ? $row[$feed->get('creator')] : '', 'published' => ($published > 0) ? $phpbb_feed_helper->format_date($published) : '', @@ -108,7 +110,7 @@ while ($row = $feed->get_item()) 'title' => censor_text($title), 'category' => ($config['feed_item_statistics'] && !empty($row['forum_id'])) ? $board_url . '/viewforum.' . $phpEx . '?f=' . $row['forum_id'] : '', 'category_name' => ($config['feed_item_statistics'] && isset($row['forum_name'])) ? $row['forum_name'] : '', - 'description' => censor_text($phpbb_feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ((isset($row['post_attachment']) && $row['post_attachment']) ? $feed->get_attachments($row['post_id']) : array()))), + 'description' => censor_text($phpbb_feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ($display_attachments ? $feed->get_attachments($row['post_id']) : array()))), 'statistics' => '', ); diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php index 8e6490923d..e35ec4baa4 100644 --- a/phpBB/phpbb/feed/forum.php +++ b/phpBB/phpbb/feed/forum.php @@ -132,6 +132,7 @@ class forum extends \phpbb\feed\post_base parent::adjust_item($item_row, $row); $item_row['title'] = (isset($row['forum_name']) && $row['forum_name'] !== '') ? $row['forum_name'] . ' ' . $this->separator . ' ' . $item_row['title'] : $item_row['title']; + $item_row['forum_id'] = $this->forum_id; } function get_item() diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php index fb49aa65cc..10b0f4f645 100644 --- a/phpBB/phpbb/feed/topic.php +++ b/phpBB/phpbb/feed/topic.php @@ -105,6 +105,13 @@ class topic extends \phpbb\feed\post_base return true; } + function adjust_item(&$item_row, &$row) + { + parent::adjust_item($item_row, $row); + + $item_row['forum_id'] = $this->forum_id; + } + function get_item() { return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row; |