summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2015-05-10 03:01:55 +0100
committerMichael Walker <mike@barrucadu.co.uk>2015-05-10 03:01:55 +0100
commit649255c9b9bff02686c1b7370474a414c70b8442 (patch)
treebcadf62e69db5486ad64e0988be9e85258e8f60c
parent4184fdec6ec3db4d80a0d429f1a3c0dae1ae2675 (diff)
When deleting a post, return to the thread, not the board index (unless deleting the OP)
-rw-r--r--inc/mod/pages.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index c8d3e2ad..07fc4ddd 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1529,7 +1529,11 @@ function mod_delete($board, $post) {
// Rebuild themes
rebuildThemes('post-delete', $board);
// Redirect
- header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
+ if(isset($_GET['thread'])) {
+ header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . str_replace('%d', $_GET['thread'], $config['file_page']), true, $config['redirect_http']);
+ } else {
+ header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']);
+ }
}
function mod_deletefile($board, $post, $file) {