From 490c766a06b7f45fe96d7ee97511b548149e33e6 Mon Sep 17 00:00:00 2001 From: towards-a-new-leftypol Date: Thu, 31 Aug 2023 14:11:52 +0000 Subject: [PATCH] Print statements --- .gitignore | 1 + inc/instance-config.php | 6 ++++-- inc/mod/pages.php | 2 ++ inc/spamnoticer.php | 3 +++ post.php | 5 +++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5cb79c3a..76331ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,4 @@ sfw/ tech/ ref/ ga/ +Test/ diff --git a/inc/instance-config.php b/inc/instance-config.php index 39b4532f..e47f91e5 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -15,6 +15,8 @@ $config['boards'] = array( array( 'b', + 'leftypol', + 'Test' ) ); @@ -27,7 +29,7 @@ $config['prepended_foreign_boards'] = array( // Board categories. Only used in the "Categories" theme. $config['categories'] = array( - 'Leftypol' => array( + 'Leftychan' => array( 'b', ) ); @@ -105,7 +107,7 @@ $config['thread_subject_in_title'] = true; // this functionality is permanently disabled. $config['spam']['enabled'] = false; $config['spam_noticer']['enabled'] = true; -$config['spam_noticer']['base_url'] = 'http://192.168.4.6:8888'; +$config['spam_noticer']['base_url'] = 'http://localhost:8300'; $config['spam_noticer']['website_name'] = "leftychan_dev"; /* diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 6ea89440..2d4f9f81 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1810,6 +1810,7 @@ function mod_ban_post(string $board, $delete, $post_num, $token = false) { $will_spamnoticer = isset($_POST['spamnoticer']); require_once 'inc/spamnoticer.php'; + require_once 'inc/anti-bot.php'; if ($will_spamnoticer) { $spamnoticer_info = parse_spamnoticer_content_fields($_POST, $po); @@ -1820,6 +1821,7 @@ function mod_ban_post(string $board, $delete, $post_num, $token = false) { $po, $board, $spamnoticer_info); + print_err('$spamnoticer_result: ' . $spamnoticer_result); } $will_ban = $spamnoticer_info->ban; diff --git a/inc/spamnoticer.php b/inc/spamnoticer.php index ddd7cb19..feadab96 100644 --- a/inc/spamnoticer.php +++ b/inc/spamnoticer.php @@ -137,6 +137,7 @@ function addToSpamNoticer($config, $post, $boardname, BanFormFieldsForSpamnotice $status_code = $response->getStatusCode(); $result_body = (string) $response->getBody(); + print_err($result_body); return "$status_code $result_body"; } catch (GuzzleHttp\Exception\ConnectException $e) { @@ -204,6 +205,8 @@ function checkWithSpamNoticer($config, $post, $boardname) { $result->client = $client; + print_err($response->getBody()); + return $result; } catch (GuzzleHttp\Exception\ConnectException $e) { $result->reason = $e->getMessage(); diff --git a/post.php b/post.php index 915b598d..7e0bd174 100644 --- a/post.php +++ b/post.php @@ -6,6 +6,7 @@ require_once 'inc/functions.php'; require_once 'inc/anti-bot.php'; require_once 'inc/bans.php'; +require_once 'inc/anti-bot.php'; // DELETE ME FOR DEBUGGING ONLY use Ramsey\Uuid\Uuid; @@ -416,11 +417,15 @@ function handle_report(){ function handle_post(){ global $config,$dropped_post,$board, $mod,$pdo; + print_err('handle_post BEGIN'); if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) { + print_err('handle_post bot error 1'); error($config['error']['bot']); } + print_err('handle_post NO SUCH bot error 1'); + $post = array('board' => $_POST['board'], 'files' => array()); // Check if board exists