Skip to content

Commit

Permalink
Merge pull request savetheinternet#195 from ptchan-foss/master
Browse files Browse the repository at this point in the history
Fixed report syslog message
  • Loading branch information
czaks authored Aug 12, 2016
2 parents 7bec8a0 + 8548a4f commit a209216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions post.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@
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)");
Expand Down

0 comments on commit a209216

Please sign in to comment.