Compare commits

..

2 Commits

3 changed files with 10 additions and 5 deletions

View File

@ -258,7 +258,7 @@ function _create_antibot($board, $thread) {
$query->bindValue(':hash', $antibot->hash()); $query->bindValue(':hash', $antibot->hash());
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
$antibot->printErrVars(); //$antibot->printErrVars();
return $antibot; return $antibot;
} }
@ -266,7 +266,12 @@ function _create_antibot($board, $thread) {
function dumpVars($extra_salt) { function dumpVars($extra_salt) {
global $config; global $config;
print_err("Check Spam POST data: " . json_encode($_POST)); $json_repr = json_encode($_POST);
print_err("Check Spam POST data: " . $json_repr);
if ($json_repr === false) {
print_err("Could not jsonify POST data: " . json_last_error_message());
}
/* /*
foreach ($_POST as $name => $value) { foreach ($_POST as $name => $value) {
@ -344,7 +349,8 @@ function checkSpam(array $extra_salt = array()) {
// there was no database entry for this hash. most likely expired. // there was no database entry for this hash. most likely expired.
print_err("checkSpam: there was no database entry for this hash. most likely expired. $hash"); print_err("checkSpam: there was no database entry for this hash. most likely expired. $hash");
dumpVars($extra_salt_orig); dumpVars($extra_salt_orig);
return true; return $hash; // do not consider this a failure case. (I would rather a spam post than a false-positive tbqh)
//return true;
} }
return $hash; return $hash;

View File

@ -133,6 +133,7 @@ $config['post_date'] = '%F (%a) %T';
$config['thread_subject_in_title'] = true; $config['thread_subject_in_title'] = true;
$config['spam']['enabled'] = true; $config['spam']['enabled'] = true;
$config['spam']['hidden_inputs_expire'] = 60 * 60 * 24 * 120; //keep hashes for 120 days in the database just in case someone posts on a slow board.
$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']['ui_url'] = 'https://spamnoticer.leftychan.net/static/index.html'; $config['spam_noticer']['ui_url'] = 'https://spamnoticer.leftychan.net/static/index.html';

View File

@ -579,11 +579,9 @@ function handle_post(){
); );
//$post['antispam_hash'] = checkSpam(); //$post['antispam_hash'] = checkSpam();
/*
if ($post['antispam_hash'] === true) { if ($post['antispam_hash'] === true) {
error($config['error']['spam']); error($config['error']['spam']);
} }
*/
} }
if ($config['robot_enable'] && $config['robot_mute']) { if ($config['robot_enable'] && $config['robot_mute']) {