diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-01-01 22:12:31 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-01-01 22:12:31 +1100 |
| commit | e4016687321770054d134f13f3275fc0523588e8 (patch) | |
| tree | a82919ab0620698454e571c2fee79e56d6d59cbd /inc/mod.php | |
| parent | 2179b03980fbb21f5f0723367438fecff1324acb (diff) | |
Fixed major security bug and image deleting
Diffstat (limited to 'inc/mod.php')
| -rw-r--r-- | inc/mod.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/mod.php b/inc/mod.php index a2ee93ce..c73b72f0 100644 --- a/inc/mod.php +++ b/inc/mod.php @@ -159,7 +159,12 @@ // Delete file @unlink($board['dir'] . DIR_IMG . $post['file']); + // Update database + $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = 'deleted' WHERE `id` = :id OR `thread` = :id", $board['uri'])); + $query->bindValue(':id', $id, PDO::PARAM_INT); + $query->execute() or error(db_error($query)); + buildThread($post['thread']); } // Delete a post (reply or thread) |
