diff options
| author | Marcin Ćabanowski <marcin@6irc.net> | 2016-08-12 19:21:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-12 19:21:35 +0200 |
| commit | a2092166567ef78c6fa4410650e858fcaead0caa (patch) | |
| tree | 2706f57e336fbee96e907e7e79ce6ed62ab5bd17 | |
| parent | 7bec8a0a8561dfd5bfd56a030fa429a3e0d86291 (diff) | |
| parent | 8548a4ff703acd5a77e4ce678eeb88e4261a1aa6 (diff) | |
Merge pull request #195 from ptchan-foss/master
Fixed report syslog message
| -rw-r--r-- | post.php | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)"); |
