diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-28 22:30:56 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-28 22:30:56 +1000 |
| commit | 7a4e481333c3ab39ea63c2d961a7c05016b12460 (patch) | |
| tree | ff61e72a73e48d7bc1af4daa18703f11f72f7b0f | |
| parent | c31e374a71a5109b136327b89b51a34f9bf8809f (diff) | |
Huge bugfix: Old tracked cites where not being purged correctly. Recommend query: "TRUNCATE TABLE `cites`;" to start over
| -rw-r--r-- | inc/functions.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/inc/functions.php b/inc/functions.php index 6ce0b29e..e2289ef1 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -997,9 +997,8 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) { if (isset($tmp_board)) openBoard($tmp_board); - $query = prepare("DELETE FROM ``cites`` WHERE (`target_board` = :board AND `target` = :id) OR (`board` = :board AND `post` = :id)"); + $query = prepare("DELETE FROM ``cites`` WHERE (`target_board` = :board AND `target` = (" . implode(' OR `target` = ', $ids) . ")) OR (`board` = :board AND (`post` = " . implode(' OR `post` = ', $ids) . "))"); $query->bindValue(':board', $board['uri']); - $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); if (isset($rebuild) && $rebuild_after) { |
