summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'post.php')
-rw-r--r--post.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/post.php b/post.php
index 77c03439..4e5114b4 100644
--- a/post.php
+++ b/post.php
@@ -79,6 +79,7 @@ if (isset($_POST['delete'])) {
$is_mod = isset($_POST['mod']) && $_POST['mod'];
$root = $is_mod ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
+ if (!$is_mod) header('X-Associated-Content: "' . $root . $board['dir'] . $config['file_index'] . '"');
header('Location: ' . $root . $board['dir'] . $config['file_index'], true, $config['redirect_http']);
} elseif (isset($_POST['report'])) {
@@ -117,25 +118,24 @@ if (isset($_POST['delete'])) {
$thread = $query->fetchColumn();
- if ($thread) {
- if ($config['syslog'])
- _syslog(LOG_INFO, 'Reported post: ' .
- '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $thread ? $thread : $id) . ($thread ? '#' . $id : '') .
- ' for "' . $reason . '"'
- );
- $query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)");
- $query->bindValue(':time', time(), PDO::PARAM_INT);
- $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
- $query->bindValue(':board', $board['uri'], PDO::PARAM_INT);
- $query->bindValue(':post', $id, PDO::PARAM_INT);
- $query->bindValue(':reason', $reason, PDO::PARAM_STR);
- $query->execute() or error(db_error($query));
- }
+ if ($config['syslog'])
+ _syslog(LOG_INFO, 'Reported post: ' .
+ '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $thread ? $thread : $id) . ($thread ? '#' . $id : '') .
+ ' for "' . $reason . '"'
+ );
+ $query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)");
+ $query->bindValue(':time', time(), PDO::PARAM_INT);
+ $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
+ $query->bindValue(':board', $board['uri'], PDO::PARAM_INT);
+ $query->bindValue(':post', $id, PDO::PARAM_INT);
+ $query->bindValue(':reason', $reason, PDO::PARAM_STR);
+ $query->execute() or error(db_error($query));
}
$is_mod = isset($_POST['mod']) && $_POST['mod'];
$root = $is_mod ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
+ if (!$is_mod) header('X-Associated-Content: "' . $root . $board['dir'] . $config['file_index'] . '"');
header('Location: ' . $root . $board['dir'] . $config['file_index'], true, $config['redirect_http']);
} elseif (isset($_POST['post'])) {
@@ -679,6 +679,8 @@ if (isset($_POST['delete'])) {
_syslog(LOG_INFO, 'New post: /' . $board['dir'] . $config['dir']['res'] .
sprintf($config['file_page'], $post['op'] ? $id : $post['thread']) . (!$post['op'] ? '#' . $id : ''));
+ if (!$post['mod']) header('X-Associated-Content: "' . $redirect . '"');
+
if ($post['op'])
rebuildThemes('post-thread', $board['uri']);
else