enable ant-bot

This commit is contained in:
towards-a-new-leftypol 2023-09-05 18:47:56 +00:00
parent 4e0ba09299
commit 598aed5b7e
3 changed files with 2 additions and 5 deletions

View File

@ -281,7 +281,6 @@ function checkSpam(array $extra_salt = array()) {
// Iterate through each input // Iterate through each input
foreach ($inputs as $name => $value) { foreach ($inputs as $name => $value) {
print_err("-> " . $name . ' : ' . $value);
$_hash .= $name . '=' . $value; $_hash .= $name . '=' . $value;
} }
@ -292,7 +291,6 @@ function checkSpam(array $extra_salt = array()) {
$_hash = sha1($_hash . $extra_salt); $_hash = sha1($_hash . $extra_salt);
if ($hash != $_hash) { if ($hash != $_hash) {
print_err("Hash mismatch");
return true; return true;
} }

View File

@ -104,8 +104,7 @@ $config['post_date'] = '%F (%a) %T';
$config['thread_subject_in_title'] = true; $config['thread_subject_in_title'] = true;
// this functionality is permanently disabled. $config['spam']['enabled'] = true;
$config['spam']['enabled'] = false;
$config['spam_noticer']['enabled'] = true; $config['spam_noticer']['enabled'] = true;
$config['spam_noticer']['base_url'] = 'http://localhost:8300'; $config['spam_noticer']['base_url'] = 'http://localhost:8300';
$config['spam_noticer']['website_name'] = "leftychan_dev"; $config['spam_noticer']['website_name'] = "leftychan_dev";

View File

@ -6,7 +6,6 @@
require_once 'inc/functions.php'; require_once 'inc/functions.php';
require_once 'inc/anti-bot.php'; require_once 'inc/anti-bot.php';
require_once 'inc/bans.php'; require_once 'inc/bans.php';
require_once 'inc/anti-bot.php'; // DELETE ME FOR DEBUGGING ONLY
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
@ -534,6 +533,7 @@ function handle_post(){
} }
if (!$post['mod'] && $config['spam']['enabled'] == true) { if (!$post['mod'] && $config['spam']['enabled'] == true) {
print_err("ANTI SPAM IS ENABLED");
$post['antispam_hash'] = checkSpam( $post['antispam_hash'] = checkSpam(
array($board['uri'], array($board['uri'],
isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null)) isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))