summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorptchan-foss <admin@ptchan.net>2016-08-12 18:18:54 +0100
committerGitHub <noreply@github.com>2016-08-12 18:18:54 +0100
commit8548a4ff703acd5a77e4ce678eeb88e4261a1aa6 (patch)
tree2706f57e336fbee96e907e7e79ce6ed62ab5bd17 /post.php
parent7bec8a0a8561dfd5bfd56a030fa429a3e0d86291 (diff)
Fixed report syslog message
Diffstat (limited to 'post.php')
-rw-r--r--post.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/post.php b/post.php
index 753d2006..0f58dd4c 100644
--- a/post.php
+++ b/post.php
@@ -148,15 +148,15 @@ if (isset($_POST['delete'])) {
markup($reason);
foreach ($report as &$id) {
- $query = prepare(sprintf("SELECT `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
+ $query = prepare(sprintf("SELECT `id`, `thread` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
- $thread = $query->fetchColumn();
+ $post = $query->fetch(PDO::FETCH_ASSOC);
if ($config['syslog'])
_syslog(LOG_INFO, 'Reported post: ' .
- '/' . $board['dir'] . $config['dir']['res'] . link_for($post) . ($thread ? '#' . $id : '') .
+ '/' . $board['dir'] . $config['dir']['res'] . link_for($post) . ($post['thread'] ? '#' . $id : '') .
' for "' . $reason . '"'
);
$query = prepare("INSERT INTO ``reports`` VALUES (NULL, :time, :ip, :board, :post, :reason)");