Fix: Remove regex pattern length restriction (#2087)
In this PR I removed the regex pattern length restriction because from multi value variables this length can be easly reached, also if the regex is going to be too long it will be caught in the timeout. Fixes #2086
This commit is contained in:
@@ -2,7 +2,6 @@ package zabbix
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/dlclark/regexp2"
|
||||
@@ -124,13 +123,6 @@ func TestParseFilter(t *testing.T) {
|
||||
expectNoError: false,
|
||||
expectedError: "error parsing regexp: potentially dangerous regex pattern detected",
|
||||
},
|
||||
{
|
||||
name: "Pattern too long",
|
||||
filter: "/" + strings.Repeat("a", 1001) + "/",
|
||||
want: nil,
|
||||
expectNoError: false,
|
||||
expectedError: "error parsing regexp: pattern too long (max 1000 characters)",
|
||||
},
|
||||
{
|
||||
name: "Safe complex regex",
|
||||
filter: "/^[a-zA-Z0-9_-]+\\.[a-zA-Z]{2,}$/",
|
||||
|
||||
Reference in New Issue
Block a user