diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-14 17:57:25 -0400 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-04-07 14:43:51 +0200 |
commit | bcdd3d5becb6b304615ec14d94682b25f4f8db0b (patch) | |
tree | dcb2904bca9b731d5d7d019034cc4f9369eca5b8 /phpBB/includes/mcp/mcp_queue.php | |
parent | f0176b53934e78b830b890ef46c1e8e7c233bee4 (diff) | |
download | forums-bcdd3d5becb6b304615ec14d94682b25f4f8db0b.tar forums-bcdd3d5becb6b304615ec14d94682b25f4f8db0b.tar.gz forums-bcdd3d5becb6b304615ec14d94682b25f4f8db0b.tar.bz2 forums-bcdd3d5becb6b304615ec14d94682b25f4f8db0b.tar.xz forums-bcdd3d5becb6b304615ec14d94682b25f4f8db0b.zip |
[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
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index a46c4bd499..8d998919e5 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -1163,6 +1163,22 @@ class mcp_queue $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); $message = $user->lang[$success_msg]; |