diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-13 20:15:46 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-13 20:15:46 +1100 |
| commit | 75f7ebd49b60c679e53a7afec31281df65cfebe7 (patch) | |
| tree | 454c50d40a1a10a50348f277df97ab7329625549 /post.php | |
| parent | 250d06074d737f3658fb35e5932aeed2baf3ed8e (diff) | |
bugfix: PHP notices on raw posts
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -561,13 +561,15 @@ $id = post($post, $OP); - 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)); + if(isset($post['tracked_cites'])) { + 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)); + } } buildThread(($OP?$id:$post['thread'])); |
