Remove duplicate block for captcha to work on dev

This commit is contained in:
towards-a-new-leftypol 2021-05-08 06:28:46 -04:00
parent f0b3c0fcb6
commit ec1041e095
2 changed files with 5 additions and 18 deletions

View file

@ -474,35 +474,22 @@ function handle_post(){
}
}
if(isset($config['securimage']) && $config['secureimage']){
if(!isset($_POST['captcha'])){
error($config['error']['securimage']['missing']);
}
if(empty($_POST['captcha'])){
error($config['error']['securimage']['empty']);
}
$query=prepare('DELETE FROM captchas WHERE time<DATE_SUB(NOW(), INTERVAL 30 MINUTE)');
$query=prepare('DELETE FROM captchas WHERE ip=:ip AND code=:code LIMIT 1');
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
$query->bindValue(':code', $_POST['captcha']);
$query->execute();
if($query->rowCount()==0){
error($config['error']['securimage']['bad']);
}
}
if(isset($config['securimage']) && $config['securimage']){
if(!isset($_POST['captcha'])){
error($config['error']['securimage']['missing']);
}
if(empty($_POST['captcha'])){
error($config['error']['securimage']['empty']);
}
$query=prepare('DELETE FROM captchas WHERE time<DATE_SUB(NOW(), INTERVAL 30 MINUTE)');
$query=prepare('DELETE FROM captchas WHERE ip=:ip AND code=:code LIMIT 1');
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
$query->bindValue(':code', $_POST['captcha']);
$query->execute();
if($query->rowCount()==0){
error($config['error']['securimage']['bad']);
}