From 827853ffbdd6d14f6de4520d67cef051f151669d Mon Sep 17 00:00:00 2001 From: Andrea Santaniello Date: Tue, 20 Sep 2022 19:00:42 +0200 Subject: [PATCH] Small fixes. --- naughtylist.php | 6 +++--- naughylist.sql | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/naughtylist.php b/naughtylist.php index 6aba22a..7b719c6 100644 --- a/naughtylist.php +++ b/naughtylist.php @@ -75,7 +75,7 @@ function reportExists($db, $name, $protocol, $port, $ip) 'ip' => $ip ] ); - if(!$stmt) { return -1; } + if(!$stmt) { return false; } return $stmt->fetchColumn(); } @@ -101,7 +101,7 @@ function honeypot($name, $protocol, $port) $report = reportExists($db, $name, $protocol, $port, $ip); - if($report != -1) + if($report != false) { updateReport($db, $report); } else { @@ -129,7 +129,7 @@ function serve() { $report = reportExists($db, $name, $protocol, $port, $ip); - if($report != -1) + if($report != false) { updateReport($db, $report); } else { diff --git a/naughylist.sql b/naughylist.sql index db6160f..33c3d48 100644 --- a/naughylist.sql +++ b/naughylist.sql @@ -1,7 +1,7 @@ CREATE TABLE `naughtylist` ( `id` int(11) NOT NULL, `name` text NOT NULL, - `protocol` varchar(4) NOT NULL, + `protocol` varchar(10) NOT NULL, `port` int(11) NOT NULL, `ip` varchar(20) NOT NULL, `count` int(11) NOT NULL,