summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-12-22 15:46:19 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-12-22 15:46:19 +1100
commit0dd36bda5409124d4986ddf6a83c8804d2b72318 (patch)
tree415d83720b20c3b7fe7c1814830b2787490a2416
parent746cc17aa231e8f006c58224ee13e44fe69a05fd (diff)
logical error syslog()ing reports
-rw-r--r--post.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/post.php b/post.php
index ce1e6772..04df089d 100644
--- a/post.php
+++ b/post.php
@@ -118,16 +118,14 @@
$query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query));
- if($config['syslog']) {
- $post = $query->fetch();
-
- _syslog(LOG_INFO, 'Reported post: ' .
- '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['thread'] ? '#' . $id : '') .
- ' for "' . $reason . '"'
- );
- }
+ $post = $query->fetch();
- if($post = $query->fetch()) {
+ if($post) {
+ if($config['syslog'])
+ _syslog(LOG_INFO, 'Reported post: ' .
+ '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['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);