1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 01:10:51 +01:00

purge flood cache table after filter stuff, not before

This commit is contained in:
Michael Foster 2013-09-07 02:57:42 +10:00
parent ecda7abe92
commit 7b1a08d85c

View File

@ -212,8 +212,6 @@ function do_filters(array $post) {
} }
} }
purge_flood_table();
if (isset($has_flood)) { if (isset($has_flood)) {
if ($post['has_file']) { if ($post['has_file']) {
$query = prepare("SELECT * FROM ``flood`` WHERE `ip` = :ip OR `posthash` = :posthash OR `filehash` = :filehash"); $query = prepare("SELECT * FROM ``flood`` WHERE `ip` = :ip OR `posthash` = :posthash OR `filehash` = :filehash");
@ -224,7 +222,6 @@ function do_filters(array $post) {
$query = prepare("SELECT * FROM ``flood`` WHERE `ip` = :ip OR `posthash` = :posthash"); $query = prepare("SELECT * FROM ``flood`` WHERE `ip` = :ip OR `posthash` = :posthash");
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
$query->bindValue(':posthash', md5($post['body_nomarkup'])); $query->bindValue(':posthash', md5($post['body_nomarkup']));
} }
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
$flood_check = $query->fetchAll(PDO::FETCH_ASSOC); $flood_check = $query->fetchAll(PDO::FETCH_ASSOC);
@ -238,5 +235,7 @@ function do_filters(array $post) {
if ($filter->check($post)) if ($filter->check($post))
$filter->action(); $filter->action();
} }
purge_flood_table();
} }