From a55760299c6777fc841a9990fa9b590b17663bb8 Mon Sep 17 00:00:00 2001 From: nekomiko482 Date: Thu, 7 Jul 2016 12:53:40 +0300 Subject: [PATCH 1/2] Fixes incompatibility with BSD's md5 output format. fixes #190 --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post.php b/post.php index aa1b8235..753d2006 100644 --- a/post.php +++ b/post.php @@ -607,7 +607,7 @@ if (isset($_POST['delete'])) { error($config['error']['nomove']); if ($md5cmd) { - $output = shell_exec_error($md5cmd . " < " . escapeshellarg($upload)); + $output = shell_exec_error($md5cmd . " " . escapeshellarg($upload)); $output = explode(' ', $output); $hash = $output[0]; } From 8548a4ff703acd5a77e4ce678eeb88e4261a1aa6 Mon Sep 17 00:00:00 2001 From: ptchan-foss Date: Fri, 12 Aug 2016 18:18:54 +0100 Subject: [PATCH 2/2] Fixed report syslog message --- post.php | 6 +++--- 1 file 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)");