1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 07:08:09 +01:00

Merge branch '3.2.x' into 3.3.x

This commit is contained in:
Marc Alexander 2020-05-02 12:05:07 +02:00
commit b29a011186
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -1049,6 +1049,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
$redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
$forum_id = $request->variable('f', 0); $forum_id = $request->variable('f', 0);
$topic_id = 0;
$s_hidden_fields = array( $s_hidden_fields = array(
'post_id_list' => $post_ids, 'post_id_list' => $post_ids,
@ -1122,8 +1123,6 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
)); ));
} }
$topic_id = $request->variable('t', 0);
// Return links // Return links
$return_link = array(); $return_link = array();
if ($affected_topics == 1 && $topic_id) if ($affected_topics == 1 && $topic_id)
@ -1152,7 +1151,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
$topic_id_list = array(); $topic_id_list = array();
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
$topic_id_list[] = $row['topic_id']; $topic_id_list[] = $topic_id = $row['topic_id'];
} }
$affected_topics = count($topic_id_list); $affected_topics = count($topic_id_list);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -1183,8 +1182,6 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
$deleted_topics = ($row = $db->sql_fetchrow($result)) ? ($affected_topics - $row['topics_left']) : $affected_topics; $deleted_topics = ($row = $db->sql_fetchrow($result)) ? ($affected_topics - $row['topics_left']) : $affected_topics;
$db->sql_freeresult($result); $db->sql_freeresult($result);
$topic_id = $request->variable('t', 0);
// Return links // Return links
$return_link = array(); $return_link = array();
if ($affected_topics == 1 && !$deleted_topics && $topic_id) if ($affected_topics == 1 && !$deleted_topics && $topic_id)
@ -1203,6 +1200,12 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
} }
else else
{ {
// Remove any post id anchor
if ($anchor_pos = (strrpos($redirect, '#p')) !== false)
{
$redirect = substr($redirect, 0, $anchor_pos);
}
$success_msg = $user->lang['POST_DELETED_SUCCESS']; $success_msg = $user->lang['POST_DELETED_SUCCESS'];
} }
} }
@ -1260,7 +1263,6 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html'); confirm_box(false, $l_confirm, build_hidden_fields($s_hidden_fields), 'confirm_delete_body.html');
} }
$redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect); $redirect = reapply_sid($redirect);
if (!$success_msg) if (!$success_msg)