From b5544b2f471ce4c93b08d19919ab062725545ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Sat, 3 Jan 2015 11:39:29 +0100 Subject: [ticket/13450] Type-hint return value of $phpbb_container->get() PHPBB3-13450 --- phpBB/viewtopic.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 5f897e8d94..6ea9bc611e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -48,6 +48,7 @@ $sort_dir = request_var('sd', $default_sort_dir); $update = request_var('update', false); +/* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); $s_can_vote = false; @@ -62,6 +63,7 @@ if (!$topic_id && !$post_id) trigger_error('NO_TOPIC'); } +/* @var $phpbb_content_visibility \phpbb\content_visibility */ $phpbb_content_visibility = $phpbb_container->get('content.visibility'); // Find topic id if user requested a newer or older topic @@ -1314,6 +1316,7 @@ $db->sql_freeresult($result); // Load custom profile fields if ($config['load_cpf_viewtopic']) { + /* @var $cp \phpbb\profilefields\manager */ $cp = $phpbb_container->get('profilefields.manager'); // Grab all profile fields from users in id cache for later use - similar to the poster cache -- cgit v1.2.1 From f6e06da4c68917dafb057bf7fe19f884a3e148c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Sun, 4 Jan 2015 20:41:04 +0100 Subject: [ticket/13455] Update calls to `request_var()` PHPBB3-13455 --- phpBB/viewtopic.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 2e27871f2c..ac5b0730db 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -27,26 +27,26 @@ $user->session_begin(); $auth->acl($user->data); // Initial var setup -$forum_id = request_var('f', 0); -$topic_id = request_var('t', 0); -$post_id = request_var('p', 0); -$voted_id = request_var('vote_id', array('' => 0)); +$forum_id = $request->variable('f', 0); +$topic_id = $request->variable('t', 0); +$post_id = $request->variable('p', 0); +$voted_id = $request->variable('vote_id', array('' => 0)); $voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id; -$start = request_var('start', 0); -$view = request_var('view', ''); +$start = $request->variable('start', 0); +$view = $request->variable('view', ''); $default_sort_days = (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0; $default_sort_key = (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'; $default_sort_dir = (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'; -$sort_days = request_var('st', $default_sort_days); -$sort_key = request_var('sk', $default_sort_key); -$sort_dir = request_var('sd', $default_sort_dir); +$sort_days = $request->variable('st', $default_sort_days); +$sort_key = $request->variable('sk', $default_sort_key); +$sort_dir = $request->variable('sd', $default_sort_dir); -$update = request_var('update', false); +$update = $request->variable('update', false); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); @@ -55,7 +55,7 @@ $s_can_vote = false; /** * @todo normalize? */ -$hilit_words = request_var('hilit', '', true); +$hilit_words = $request->variable('hilit', '', true); // Do we have a topic or post id? if (!$topic_id && !$post_id) @@ -498,9 +498,9 @@ if ($config['allow_topic_notify']) } // Bookmarks -if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('bookmark', 0)) +if ($config['allow_bookmarks'] && $user->data['is_registered'] && $request->variable('bookmark', 0)) { - if (check_link_hash(request_var('hash', ''), "topic_$topic_id")) + if (check_link_hash($request->variable('hash', ''), "topic_$topic_id")) { if (!$topic_data['bookmarked']) { @@ -2141,13 +2141,13 @@ if ($s_can_vote || $s_quick_reply) // We overwrite $_REQUEST['f'] if there is no forum specified // to be able to display the correct online list. // One downside is that the user currently viewing this topic/post is not taken into account. -if (!request_var('f', 0)) +if (!$request->variable('f', 0)) { $request->overwrite('f', $forum_id); } // We need to do the same with the topic_id. See #53025. -if (!request_var('t', 0) && !empty($topic_id)) +if (!$request->variable('t', 0) && !empty($topic_id)) { $request->overwrite('t', $topic_id); } -- cgit v1.2.1 From a089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f Mon Sep 17 00:00:00 2001 From: MateBartus Date: Wed, 25 Feb 2015 21:13:20 +0100 Subject: [ticket/13654] Moving reporting into controller Moving report.php's content into different services and controllers to better comply with the MVC model. Also implementing: * Replacement for reasons_display() * Adding assign_meta_refresh_var() to \controller\helper * Adding separate routes for easy configuration * Updating unit tests to expect to correct results * Add BC tests PHPBB3-13654 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 76e7a59d5d..7b225ef3db 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1832,7 +1832,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_JABBER' => $user_cache[$poster_id]['jabber'], 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p={$row['post_id']}&f=$forum_id&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url . '&p=' . $row['post_id'] . '#p' . $row['post_id']))), - 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $row['post_id']) : '', + 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? $phpbb_container->get('controller.helper')->route('phpbb_report_post_controller', array('id' => $row['post_id'])) : '', 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', 'U_MCP_RESTORE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics') . '&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', -- cgit v1.2.1 From 7d31232846e29311e5b76bf32f41f64da7985a79 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Wed, 16 Jul 2014 18:31:12 +0200 Subject: [ticket/8708] Apply permission 'f_announce_global' PHPBB3-8708 --- phpBB/viewtopic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 4a42d78b2b..b9cb226920 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -583,10 +583,10 @@ $quickmod_array = array( 'merge' => array('MERGE_POSTS', $auth->acl_get('m_merge', $forum_id)), 'merge_topic' => array('MERGE_TOPIC', $auth->acl_get('m_merge', $forum_id)), 'fork' => array('FORK_TOPIC', $auth->acl_get('m_move', $forum_id)), - 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)), + 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', 'f_announce_global', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)), 'make_sticky' => array('MAKE_STICKY', ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY)), 'make_announce' => array('MAKE_ANNOUNCE', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE)), - 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)), + 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce_global', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)), 'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)), ); -- cgit v1.2.1 From 5988e3a192ac7ce8e647bfdf35e60304e6dd566c Mon Sep 17 00:00:00 2001 From: Michael Miday Date: Tue, 15 Sep 2015 22:43:42 +0200 Subject: [ticket/12769] Delete imageset & consolidate imgs --- phpBB/viewtopic.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index b9cb226920..2908265a97 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1912,6 +1912,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POST_ID' => $row['post_id'], 'POST_NUMBER' => $i + $start + 1, 'POSTER_ID' => $poster_id, + 'MINI_POST' => ($post_unread) ? $user->lang['UNREAD_POST'] : $user->lang['POST'], + 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, 'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1, -- cgit v1.2.1 From 3937f1f4ae77b29faf69292783cc3ae267785ee4 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sat, 12 Sep 2015 00:53:33 +0200 Subject: [ticket/14157] Allow to set the alt/title attribute on post icons PHPBB3-14157 --- phpBB/viewtopic.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index b9cb226920..b446567c5f 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1885,6 +1885,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POST_ICON_IMG' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['img'] : '', 'POST_ICON_IMG_WIDTH' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['width'] : '', 'POST_ICON_IMG_HEIGHT' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['height'] : '', + 'POST_ICON_IMG_ALT' => ($topic_data['enable_icons'] && !empty($row['icon_id'])) ? $icons[$row['icon_id']]['alt'] : '', 'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), -- cgit v1.2.1 From c5ef29a6f1729ddc6cfec18247c8a4fe13b6d333 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Mar 2016 10:41:43 +0100 Subject: [ticket/14530] Add accidentally removed sig_parsed flag This was removed by accident previously while moving from the use of the old bbcode class to the generate_test_for_display function. PHPBB3-14530 --- phpBB/viewtopic.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 87de7c79a4..392b336ce6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1597,6 +1597,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) { $parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES; $user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true); + $user_cache[$poster_id]['sig_parsed'] = true; } // Parse the message and subject -- cgit v1.2.1 From 4b6c2c8cde0b87d32f8df8af87239580ddc340c4 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Sun, 29 May 2016 12:42:57 +0200 Subject: [ticket/10961] Send HTTP 403 when applicable PHPBB3-10961 --- phpBB/viewtopic.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index ded0f9aacc..4325fafb43 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -376,6 +376,7 @@ if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id)) { if ($user->data['user_id'] != ANONYMOUS) { + send_status_line(403, 'Forbidden'); trigger_error('SORRY_AUTH_READ'); } -- cgit v1.2.1 From 7609ba71e98071cf5549de9d9baea253609ecd00 Mon Sep 17 00:00:00 2001 From: nomind60s Date: Mon, 20 Mar 2017 23:06:34 -0600 Subject: [ticket/15137] Global announcements can stick for a non-zero number of days To be consistent with Sticky and Announcements topic types, Global announcements can now stick for a non-zero number of days, i.e. they are no longer never ending. Before this change, if the topic type was Global and a non-zero number of days where set to stick topic, the number was silently ignored and a Global announcement was always never ending. PHPBB3-15137 --- phpBB/viewtopic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 378e2d8f97..e9cb2dd383 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -321,8 +321,8 @@ if ($post_id) $topic_id = (int) $topic_data['topic_id']; $topic_replies = $phpbb_content_visibility->get_count('topic_posts', $topic_data, $forum_id) - 1; -// Check sticky/announcement time limit -if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == POST_ANNOUNCE) && $topic_data['topic_time_limit'] && ($topic_data['topic_time'] + $topic_data['topic_time_limit']) < time()) +// Check sticky/announcement/global time limit +if (($topic_data['topic_type'] != POST_NORMAL) && $topic_data['topic_time_limit'] && ($topic_data['topic_time'] + $topic_data['topic_time_limit']) < time()) { $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_type = ' . POST_NORMAL . ', topic_time_limit = 0 -- cgit v1.2.1