mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11352] Redirect the user back to view*.php after disapproving
The user should be redirected back to: - the topic, if he came from viewtopic and the topic still exists - the forum, if he came from viewtopic, but the topic does not exist anymore PHPBB3-11352
This commit is contained in:
parent
f0176b5393
commit
bcdd3d5bec
1 changed files with 16 additions and 0 deletions
|
@ -1163,6 +1163,22 @@ class mcp_queue
|
||||||
$success_msg .= '_DELETED_SUCCESS';
|
$success_msg .= '_DELETED_SUCCESS';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we came from viewtopic, we try to go back to it.
|
||||||
|
if (strpos($redirect, $phpbb_root_path . 'viewtopic.' . $phpEx) === 0)
|
||||||
|
{
|
||||||
|
if ($num_disapproved_topics == 0)
|
||||||
|
{
|
||||||
|
// So we need to remove the post id part from the Url
|
||||||
|
$redirect = str_replace("&p={$post_id_list[0]}#p{$post_id_list[0]}", '', $redirect);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// However this is only possible if the topic still exists,
|
||||||
|
// Otherwise we go back to the viewforum page
|
||||||
|
$redirect = append_sid($phpbb_root_path . 'viewforum.' . $phpEx, 'f=' . $request->variable('f', 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
meta_refresh(3, $redirect);
|
meta_refresh(3, $redirect);
|
||||||
$message = $user->lang[$success_msg];
|
$message = $user->lang[$success_msg];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue