diff options
| author | czaks <marcin@6irc.net> | 2013-07-31 21:03:13 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-07-31 21:03:13 -0400 |
| commit | 83844b5e3e5e29c71f1820901928eb5030eda6cb (patch) | |
| tree | 33126ec603d83aebc5575f45e7388766de506ce9 /post.php | |
| parent | 03d91df1d8af49aa1fd9e87fa8e9643b52fd52d9 (diff) | |
| parent | 0f9df0ac6608d3398cd480465dcab1b0227ec9c0 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts:
inc/functions.php
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -52,7 +52,7 @@ if (isset($_POST['delete'])) { $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - if ($post = $query->fetch()) { + if ($post = $query->fetch(PDO::FETCH_ASSOC)) { if ($password != '' && $post['password'] != $password) error($config['error']['invalidpassword']); @@ -116,12 +116,12 @@ if (isset($_POST['delete'])) { $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); - $post = $query->fetch(); + $thread = $query->fetchColumn(); - if ($post) { + if ($thread) { 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 : '') . + '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $thread ? $thread : $id) . ($thread ? '#' . $id : '') . ' for "' . $reason . '"' ); $query = prepare("INSERT INTO `reports` VALUES (NULL, :time, :ip, :board, :post, :reason)"); @@ -233,7 +233,7 @@ if (isset($_POST['delete'])) { $query->bindValue(':id', $post['thread'], PDO::PARAM_INT); $query->execute() or error(db_error()); - if (!$thread = $query->fetch()) { + if (!$thread = $query->fetch(PDO::FETCH_ASSOC)) { // Non-existant error($config['error']['nonexistant']); } |
