summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-11 09:50:33 -0400
committerczaks <marcin@6irc.net>2013-08-11 09:50:33 -0400
commitfa9bf536c356a49bf5d182a52f3ab47ea0c1b227 (patch)
tree12b45d039c0688d03f1066a32c38f594385ed47f /post.php
parentebac98e207290d5beddb0af6c8b259e15e9da361 (diff)
parent0de3ead32a42c5d5c1640765beb7147ea991ae1d (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: inc/config.php inc/display.php inc/mod/pages.php js/catalog-link.js post.php templates/banned.html
Diffstat (limited to 'post.php')
-rw-r--r--post.php33
1 files changed, 13 insertions, 20 deletions
diff --git a/post.php b/post.php
index 98709d97..4c34b806 100644
--- a/post.php
+++ b/post.php
@@ -117,26 +117,19 @@ if (isset($_POST['delete'])) {
$query->execute() or error(db_error($query));
$thread = $query->fetchColumn();
-
- // If they are not reporting a reply, report the OP.
- if (!$thread) {
- $thread = $id;
- }
-
- 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'];