From 926a0a4e3310319d62490398ce88b2233591ee90 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 8 Jul 2024 16:35:41 +0100 Subject: [PATCH] [ticket/17369] Add forum id to approve action url for redirection Added the forum_id to the approve action link which ensures that when a topic is permanently deleted, the forum_id is present so that it can be used in the redirection link to go to the previous forum. This addresses a bug in which the forum_id is not provided and after deleting a topic, the user will be taken to a 404 page as the forum id fallbacks to 0. PHPBB-17369 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index bdc28731d7..47172cfc60 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -2071,7 +2071,7 @@ for ($i = 0, $end = count($post_list); $i < $end; ++$i) 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], - 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p={$row['post_id']}&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url . '&p=' . $row['post_id'] . '#p' . $row['post_id']))), + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p={$row['post_id']}&f={$row['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)) ? $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&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&p=' . $row['post_id'], true, $user->session_id) : '',