Bugfix: deleting OP image didn't rebuild
This commit is contained in:
parent
6775eebcfa
commit
97dd6ab391
@ -803,12 +803,8 @@ function deleteFile($id, $remove_entirely_if_already=true) {
|
|||||||
$query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri']));
|
$query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id LIMIT 1", $board['uri']));
|
||||||
$query->bindValue(':id', $id, PDO::PARAM_INT);
|
$query->bindValue(':id', $id, PDO::PARAM_INT);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
if (!$post = $query->fetch())
|
||||||
if ($query->rowCount() < 1) {
|
|
||||||
error($config['error']['invalidpost']);
|
error($config['error']['invalidpost']);
|
||||||
}
|
|
||||||
|
|
||||||
$post = $query->fetch();
|
|
||||||
|
|
||||||
if ($post['file'] == 'deleted' && !$post['thread'])
|
if ($post['file'] == 'deleted' && !$post['thread'])
|
||||||
return; // Can't delete OP's image completely.
|
return; // Can't delete OP's image completely.
|
||||||
@ -827,13 +823,14 @@ function deleteFile($id, $remove_entirely_if_already=true) {
|
|||||||
// Set file to 'deleted'
|
// Set file to 'deleted'
|
||||||
$query->bindValue(':file', 'deleted', PDO::PARAM_INT);
|
$query->bindValue(':file', 'deleted', PDO::PARAM_INT);
|
||||||
}
|
}
|
||||||
// Update database
|
|
||||||
|
|
||||||
$query->bindValue(':id', $id, PDO::PARAM_INT);
|
$query->bindValue(':id', $id, PDO::PARAM_INT);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
|
||||||
if ($post['thread'])
|
if ($post['thread'])
|
||||||
buildThread($post['thread']);
|
buildThread($post['thread']);
|
||||||
|
else
|
||||||
|
buildThread($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rebuild post (markup)
|
// rebuild post (markup)
|
||||||
|
Loading…
Reference in New Issue
Block a user