diff --git a/inc/spamnoticer.php b/inc/spamnoticer.php index d661f2a2..b7c3585b 100644 --- a/inc/spamnoticer.php +++ b/inc/spamnoticer.php @@ -296,6 +296,8 @@ function checkWithSpamNoticer($config, $post, $boardname) { print_err($body); $reasons_bitmap = json_decode($body)->reason; $result->reason = renderReasons($reasons_bitmap); + } else if ($config['debug']) { + print_err((string) $response->getBody()); } } else { print_err("spamnoticer status code: " . $status_code); diff --git a/post.php b/post.php index 18fdc961..1040ac7f 100644 --- a/post.php +++ b/post.php @@ -1044,6 +1044,10 @@ function handle_post(){ $spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']); + if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) { + error($config['error']['spam_noticer'] . $spam_noticer_result->reason); + } + /* * If we have an error with posting this later, send back the * delete token to spamnoticer to remove the post from the recent @@ -1055,10 +1059,6 @@ function handle_post(){ push_global_post_cleanup($f_spamnoticer_cleanup_on_err); - if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) { - error($config['error']['spam_noticer'] . $spam_noticer_result->reason); - } - $debug['time']['post']['spam_noticer'] = round((microtime(true) - $time_1) * 1000, 2) . 'ms'; }