From b64086ff2651d002042324e928620d7e7faedf8f Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Sat, 8 May 2021 06:28:46 -0400 Subject: [PATCH] Remove duplicate block for captcha to work on dev --- inc/captchaconfig.php | 2 +- post.php | 21 ++++----------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/inc/captchaconfig.php b/inc/captchaconfig.php index 793c0293..9c3f43f3 100644 --- a/inc/captchaconfig.php +++ b/inc/captchaconfig.php @@ -59,7 +59,7 @@ return array( 'session_name' => null, // change to true to store codes in a database - 'use_database' => false, + 'use_database' => true, // database engine to use for storing codes. must have the PDO extension loaded // Values choices are: diff --git a/post.php b/post.php index 54da87c9..02eeb866 100644 --- a/post.php +++ b/post.php @@ -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 timebindValue(':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 timebindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':code', $_POST['captcha']); $query->execute(); + if($query->rowCount()==0){ error($config['error']['securimage']['bad']); }