From ce123807279506d10f79fdf7214b1ea12b654648 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 11 Dec 2024 22:05:51 -0500 Subject: switch to POST for posting comments --- src/web/_model/_comments.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/web/_model') diff --git a/src/web/_model/_comments.php b/src/web/_model/_comments.php index f36c642..3518508 100644 --- a/src/web/_model/_comments.php +++ b/src/web/_model/_comments.php @@ -1,6 +1,13 @@ profanity = $this->load_profanity(); + } + private function load_profanity() { $path = ASSET_ROOT . '/profanity.txt'; @@ -24,8 +31,7 @@ class _comments_model extends Model { public function is_vulgar($text) { - $profanity = $this->load_profanity(); - return preg_match($profanity, $text); + return preg_match($this->profanity, $text); } public function get_comments($page) @@ -45,15 +51,6 @@ class _comments_model extends Model { return $result; } - public function ban_user() - { - $ip = CONTEXT['ip']; - $this->db() - ->insert_into('admin.banned', 'ip', 'reason') - ->values($ip, 'vulgar language') - ->execute(); - } - public function post_comment($author, $content, $page, $vulgar) { $ip = CONTEXT['ip']; -- cgit v1.2.3-freya