aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_queue.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-04-10 13:56:30 -0700
committerNils Adermann <naderman@naderman.de>2014-04-10 13:56:30 -0700
commit79fe7816293435baceaecafc5a84fbb09c33afaa (patch)
treea859a775a6ff8a95d1817376fb71299be181e5f3 /phpBB/includes/mcp/mcp_queue.php
parent2284e2897f2573467a20cb90579e7b4bb8af392c (diff)
parent6593e028be51acb9499a20fb5b8df188c1197da0 (diff)
downloadforums-79fe7816293435baceaecafc5a84fbb09c33afaa.tar
forums-79fe7816293435baceaecafc5a84fbb09c33afaa.tar.gz
forums-79fe7816293435baceaecafc5a84fbb09c33afaa.tar.bz2
forums-79fe7816293435baceaecafc5a84fbb09c33afaa.tar.xz
forums-79fe7816293435baceaecafc5a84fbb09c33afaa.zip
Merge remote-tracking branch 'github-nickvergessen/ticket/11352' into develop-ascraeus
* github-nickvergessen/ticket/11352: [ticket/11352] Add functional tests for disapproving a post/topic [ticket/11352] Redirect the user back to view*.php after disapproving
Diffstat (limited to 'phpBB/includes/mcp/mcp_queue.php')
-rw-r--r--phpBB/includes/mcp/mcp_queue.php16
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("&amp;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];