diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-07 12:58:23 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-07 12:58:23 +1000 |
| commit | b7f16dee0f4554f5e607e50f773af6852e716513 (patch) | |
| tree | 1dd2247639179984be5ce2f163c3014875f5f10f /inc/filters.php | |
| parent | 55dc5cedc338f56268d8e302cdc52e97206543de (diff) | |
Add ! syntax (NOT) to filters. Don't throttle duplicate post bodies when they are empty
Diffstat (limited to 'inc/filters.php')
| -rw-r--r-- | inc/filters.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/inc/filters.php b/inc/filters.php index 27b167ea..5c934532 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -168,11 +168,14 @@ class Filter { public function check(array $post) { foreach ($this->condition as $condition => $value) { - if (!$this->match($post, $condition, $value)) + if ($condition[0] == '!') { + $NOT = true; + $condition = substr($condition, 1); + } else $NOT = false; + + if ($this->match($post, $condition, $value) == $NOT) return false; } - - /* match */ return true; } } |
