From 1d922c2508dd4bfbcca13f07bb6d145acc672624 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 10 Jul 2021 18:18:55 -0600 Subject: [PATCH] MySQL is really silly about table names. --- endpoints/net.contactspam.php | 4 ++-- endpoints/net.contactspam.submit.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/endpoints/net.contactspam.php b/endpoints/net.contactspam.php index 37433f9..eb5d00e 100644 --- a/endpoints/net.contactspam.php +++ b/endpoints/net.contactspam.php @@ -135,12 +135,12 @@ try { // Check local spammer database if (env("require_database")) { if (!empty($clientip)) { - if ($database->has("net_contactspam-spammers", ["ip" => $clientip])) { + if ($database->has("net_contactspam_spammers", ["ip" => $clientip])) { exitWithJson(["status" => "OK", "clean" => false, "filter" => "netsyms_ip_blacklist", "hit" => $clientip, "message" => "A computer at your IP address has sent spam in the past. Your message has been blocked."]); } } if (!empty($clientip)) { - if ($database->has("net_contactspam-spammers", ["email" => $email_lower])) { + if ($database->has("net_contactspam_spammers", ["email" => $email_lower])) { exitWithJson(["status" => "OK", "clean" => false, "filter" => "netsyms_email_blacklist", "hit" => $clientip, "message" => "Someone put your email as the from address on a spam message. Your message has been blocked."]); } } diff --git a/endpoints/net.contactspam.submit.php b/endpoints/net.contactspam.submit.php index a84807f..77a87fb 100644 --- a/endpoints/net.contactspam.submit.php +++ b/endpoints/net.contactspam.submit.php @@ -5,13 +5,13 @@ $clientip = $VARS["ipaddr"] ?? ""; if (!empty($fromemail) && filter_var($fromemail, FILTER_VALIDATE_EMAIL)) { $fromemail = strtolower($fromemail); - if ($database->has("net_contactspam-spammers", ["email" => $fromemail])) { - $database->update("net_contactspam-spammers", [ + if ($database->has("net_contactspam_spammers", ["email" => $fromemail])) { + $database->update("net_contactspam_spammers", [ "entrylastreported" => date("Y-m-d H:i:s"), "reportcount[+]" => 1 ], ["email" => $fromemail]); } else { - $database->insert("net_contactspam-spammers", [ + $database->insert("net_contactspam_spammers", [ "entrylastreported" => date("Y-m-d H:i:s"), "reportcount" => 1, "email" => $fromemail @@ -20,13 +20,13 @@ if (!empty($fromemail) && filter_var($fromemail, FILTER_VALIDATE_EMAIL)) { } if (!empty($clientip) && filter_var($clientip, FILTER_VALIDATE_IP)) { - if ($database->has("net_contactspam-spammers", ["ip" => $clientip])) { - $database->update("net_contactspam-spammers", [ + if ($database->has("net_contactspam_spammers", ["ip" => $clientip])) { + $database->update("net_contactspam_spammers", [ "entrylastreported" => date("Y-m-d H:i:s"), "reportcount[+]" => 1 ], ["ip" => $clientip]); } else { - $database->insert("net_contactspam-spammers", [ + $database->insert("net_contactspam_spammers", [ "entrylastreported" => date("Y-m-d H:i:s"), "reportcount" => 1, "ip" => $clientip