forked from GithubBackups/vichan
functions.php: format _create_antibot
This commit is contained in:
parent
609da43548
commit
ee20bf574a
@ -1615,21 +1615,23 @@ function checkMute() {
|
||||
function _create_antibot($board, $thread) {
|
||||
global $config, $purged_old_antispam;
|
||||
|
||||
$antibot = new AntiBot(array($board, $thread));
|
||||
$antibot = new AntiBot([$board, $thread]);
|
||||
|
||||
if (!isset($purged_old_antispam)) {
|
||||
$purged_old_antispam = true;
|
||||
query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error());
|
||||
}
|
||||
|
||||
if ($thread)
|
||||
if ($thread) {
|
||||
$query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread AND `expires` IS NULL');
|
||||
else
|
||||
} else {
|
||||
$query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` IS NULL AND `expires` IS NULL');
|
||||
}
|
||||
|
||||
$query->bindValue(':board', $board);
|
||||
if ($thread)
|
||||
if ($thread) {
|
||||
$query->bindValue(':thread', $thread);
|
||||
}
|
||||
$query->bindValue(':expires', $config['spam']['hidden_inputs_expire']);
|
||||
$query->execute() or error(db_error($query));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user