summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorfallenPineapple <fallenPineapple87@gmail.com>2013-08-10 17:16:30 -0400
committerfallenPineapple <fallenPineapple87@gmail.com>2013-08-10 17:16:30 -0400
commit12ee85beafcb545fcb3a71eb1ad9cf90c329df33 (patch)
tree8919c8804160f947d58628a8589b7448fd104079 /post.php
parent1248e329d20eeddbd9eea3b81bb59d42461d0893 (diff)
Adds "noko50" (View Last 50 Posts) pages. (Broken Reply)
Diffstat (limited to 'post.php')
-rw-r--r--post.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/post.php b/post.php
index ab4775eb..a6997f45 100644
--- a/post.php
+++ b/post.php
@@ -656,6 +656,20 @@ if (isset($_POST['delete'])) {
if ($config['always_noko'] || $noko) {
$redirect = $root . $board['dir'] . $config['dir']['res'] .
sprintf($config['file_page'], $post['op'] ? $id:$post['thread']) . (!$post['op'] ? '#' . $id : '');
+
+ if (!$post['op'] && isset($_SERVER['HTTP_REFERER'])) {
+ $regex = array(
+ 'board' => str_replace('%s', '(\w{1,8})', preg_quote($config['board_path'], '/')),
+ 'page' => str_replace('%d', '(\d+)', preg_quote($config['file_page'], '/')),
+ 'page50' => str_replace('%d', '(\d+)', preg_quote($config['file_page50'], '/')),
+ 'res' => preg_quote($config['dir']['res'], '/'),
+ );
+
+ if (preg_match('/\/' . $regex['board'] . $regex['res'] . $regex['page50'] . '([?&].*)?$/', $_SERVER['HTTP_REFERER'])) {
+ $redirect = $root . $board['dir'] . $config['dir']['res'] .
+ sprintf($config['file_page50'], $post['op'] ? $id:$post['thread']) . (!$post['op'] ? '#' . $id : '');
+ }
+ }
} else {
$redirect = $root . $board['dir'] . $config['file_index'];