diff options
Diffstat (limited to 'src/web/_model')
-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']; |