logical error syslog()ing reports

This commit is contained in:
Savetheinternet 2011-12-22 15:46:19 +11:00
parent 746cc17aa2
commit 0dd36bda54

View File

@ -118,16 +118,14 @@
$query->bindValue(':id', $id, PDO::PARAM_INT); $query->bindValue(':id', $id, PDO::PARAM_INT);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
if($config['syslog']) { $post = $query->fetch();
$post = $query->fetch();
_syslog(LOG_INFO, 'Reported post: ' . if($post) {
'/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['thread'] ? '#' . $id : '') . if($config['syslog'])
' for "' . $reason . '"' _syslog(LOG_INFO, 'Reported post: ' .
); '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['thread'] ? '#' . $id : '') .
} ' for "' . $reason . '"'
);
if($post = $query->fetch()) {
$query = prepare("INSERT INTO `reports` VALUES (NULL, :time, :ip, :board, :post, :reason)"); $query = prepare("INSERT INTO `reports` VALUES (NULL, :time, :ip, :board, :post, :reason)");
$query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':time', time(), PDO::PARAM_INT);
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);