From 43f11d1368f188d494e645bb0e262a5b90156cad Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Fri, 8 Feb 2019 09:49:23 -0600
Subject: [PATCH] issue: System Ban List

This addresses an issue where the system banlist throws the error "SYSTEM
BAN LIST filter is DISABLED". This is due to the Filters moving to ORM but
not updating everywhere they are used.
---
 include/class.banlist.php | 2 +-
 include/class.filter.php  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/class.banlist.php b/include/class.banlist.php
index 9b436bc3b..8b1ebba92 100644
--- a/include/class.banlist.php
+++ b/include/class.banlist.php
@@ -81,7 +81,7 @@ class Banlist {
     }
 
     function getSystemBanList() {
-        return new Filter(self::ensureSystemBanList());
+        return self::ensureSystemBanList();
     }
 
     static function getFilter() {
diff --git a/include/class.filter.php b/include/class.filter.php
index 2170f412b..8c3abe842 100755
--- a/include/class.filter.php
+++ b/include/class.filter.php
@@ -184,7 +184,8 @@ extends VerySimpleModel {
         $rule = array_merge($extra,array('what'=>$what, 'how'=>$how, 'val'=>$val));
         $rule = new FilterRule($rule);
         $this->rules->add($rule);
-        $rule->save();
+        if ($rule->save())
+            return true;
     }
 
     function removeRule($what, $how, $val) {
@@ -200,7 +201,7 @@ extends VerySimpleModel {
     }
 
     function getRuleById($id) {
-        return FilterRule::lookup($id, $this->getId());
+        return FilterRule::lookup(array('id'=>$id, 'filter_id'=>$this->getId()));
     }
 
     function containsRule($what, $how, $val) {
-- 
GitLab