Increased filehash length and made the reject-post-if-image-already-exists-in-active-content thing

This commit is contained in:
Savetheinternet 2011-02-19 19:45:54 +11:00
parent 13ef38d7b7
commit efa06c270e
4 changed files with 32 additions and 4 deletions

View file

@ -1121,7 +1121,20 @@
return $res;
}
function getPostByHash($hash) {
global $board;
$query = prepare(sprintf("SELECT `id`,`thread` FROM `posts_%s` WHERE `filehash` = :hash", $board['uri']));
$query->bindValue(':hash', $hash, PDO::PARAM_STR);
$query->execute() or error(db_error($query));
if($post = $query->fetch()) {
return $post;
}
return false;
}
function undoImage($post) {
unlink($post['file']);
unlink($post['thumb']);