diff options
author | Freya Murphy <freya@freyacat.org> | 2024-12-11 22:05:51 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-12-11 22:05:51 -0500 |
commit | ce123807279506d10f79fdf7214b1ea12b654648 (patch) | |
tree | 29fff07f47e8e548af3db219621121aa2715347f /src/web/_model/_comments.php | |
parent | update error lang (diff) | |
download | website-ce123807279506d10f79fdf7214b1ea12b654648.tar.gz website-ce123807279506d10f79fdf7214b1ea12b654648.tar.bz2 website-ce123807279506d10f79fdf7214b1ea12b654648.zip |
switch to POST for posting comments
Diffstat (limited to 'src/web/_model/_comments.php')
-rw-r--r-- | src/web/_model/_comments.php | 19 |
1 files changed, 8 insertions, 11 deletions
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 @@ <?php /* Copyright (c) 2024 Freya Murphy */ class _comments_model extends Model { + private $profanity; + + function __construct() + { + $this->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']; |