Fix NOT REGEXP rules (#8376)

* Fix NOT REGEXP rules

* not_regex -> not regex

* Fixed saving rules as well
This commit is contained in:
Neil Lathwood
2018-03-14 21:53:47 +00:00
committed by GitHub
parent 03076c4025
commit 66a3f82269
3 changed files with 11 additions and 5 deletions

View File

@@ -91,7 +91,7 @@ if (is_numeric($rule_id) && $rule_id > 0) {
'alert_rules',
'id=?',
array($rule_id)
) > 0) {
) >= 0) {
$message = "Edited Rule: <i>$name</i>";
} else {
$message = "Failed to edit Rule <i>$name</i>";

View File

@@ -158,19 +158,25 @@ if (is_admin()) {
{type: 'less_or_equal', nb_inputs: 1, multiple: false, apply_to: ['string', 'number', 'datetime']},
{type: 'greater', nb_inputs: 1, multiple: false, apply_to: ['string', 'number', 'datetime']},
{type: 'greater_or_equal', nb_inputs: 1, multiple: false, apply_to: ['string', 'number', 'datetime']},
{type: 'regexp', nb_inputs: 1, multiple: false, apply_to: ['string']}
{type: 'regex', nb_inputs: 1, multiple: false, apply_to: ['string']},
{type: 'not_regex', nb_inputs: 1, multiple: false, apply_to: ['string']}
],
lang: {
operators: {
regexp: 'regex'
regexp: 'regex',
not_regex: 'not regex'
}
},
sqlOperators: {
regexp: {op: 'REGEXP'}
regexp: {op: 'REGEXP'},
not_regexp: {op: 'NOT REGEXP'}
},
sqlRuleOperator: {
'REGEXP': function (v) {
return {val: v, op: 'regexp'};
},
'NOT REGEXP': function (v) {
return {val: v, op: 'not_regexp'};
}
}
});

File diff suppressed because one or more lines are too long