mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(filters): do not split commas inside valid Regexp (#1212)
* fix(filter): matchRegex * fix(filter): matchRegex use new splitter
This commit is contained in:
parent
db7ab7c99a
commit
1563ce5e9f
4 changed files with 45 additions and 1 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
"github.com/autobrr/autobrr/pkg/wildcard"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
"github.com/go-andiamo/splitter"
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -626,7 +627,22 @@ func matchRegex(tag string, filterList string) bool {
|
|||
if tag == "" {
|
||||
return false
|
||||
}
|
||||
filters := strings.Split(filterList, ",")
|
||||
|
||||
sp, err := splitter.NewSplitter(',',
|
||||
splitter.DoubleQuotes,
|
||||
splitter.Parenthesis,
|
||||
splitter.CurlyBrackets,
|
||||
splitter.SquareBrackets,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
filters, err := sp.Split(filterList)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, filter := range filters {
|
||||
if filter == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue