1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-01-30 03:47:31 +01:00

Huge bugfix: Old tracked cites where not being purged correctly. Recommend query: "TRUNCATE TABLE cites;" to start over

This commit is contained in:
Michael Foster 2013-08-28 22:30:56 +10:00
parent 19b7f4734f
commit 9f3dfc2448

View File

@ -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) {