Add ! syntax (NOT) to filters. Don't throttle duplicate post bodies when they are empty
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user