summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-29 07:33:19 -0400
committerczaks <marcin@6irc.net>2013-08-29 07:33:19 -0400
commit8de81d176cc379687abbfebc3daa72e96068d49a (patch)
tree87e79f53ea13449b76944dd93a17e2a10d56da91 /post.php
parentb61772361cd124c665a9356630936d8f8b4a352b (diff)
parent738179c766953fa45670e451875210c6874a41f2 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: inc/config.php
Diffstat (limited to 'post.php')
-rw-r--r--post.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/post.php b/post.php
index 867e3595..9fc4be66 100644
--- a/post.php
+++ b/post.php
@@ -684,15 +684,14 @@ if (isset($_POST['delete'])) {
incrementSpamHash($post['antispam_hash']);
}
- if (isset($post['tracked_cites'])) {
+ if (isset($post['tracked_cites']) && !empty($post['tracked_cites'])) {
+ $insert_rows = array();
foreach ($post['tracked_cites'] as $cite) {
- $query = prepare('INSERT INTO ``cites`` VALUES (:board, :post, :target_board, :target)');
- $query->bindValue(':board', $board['uri']);
- $query->bindValue(':post', $id, PDO::PARAM_INT);
- $query->bindValue(':target_board',$cite[0]);
- $query->bindValue(':target', $cite[1], PDO::PARAM_INT);
- $query->execute() or error(db_error($query));
+ $insert_rows[] = '(' .
+ $pdo->quote($board['uri']) . ', ' . (int)$id . ', ' .
+ $pdo->quote($cite[0]) . ', ' . (int)$cite[1] . ')';
}
+ query('INSERT INTO ``cites`` VALUES ' . implode(', ', $insert_rows)) or error(db_error());;
}
if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || $numposts['replies']+1 < $config['reply_limit'])) {