mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Use regexp.QuoteMeta to escape destination when having "+" in front of it
This commit is contained in:
committed by
Dan Christian Bogos
parent
bb0803bd96
commit
fbc30d600e
@@ -1033,13 +1033,10 @@ func (ms *MongoStorage) GetCDRs(qryFltr *utils.CDRsFilter, remove bool) ([]*CDR,
|
||||
if len(prefix) == 0 {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(prefix, "+") {
|
||||
prefix = "\\" + prefix
|
||||
}
|
||||
if len(regexpRule) != 0 {
|
||||
regexpRule += "|"
|
||||
}
|
||||
regexpRule += "^(" + prefix + ")"
|
||||
regexpRule += "^(" + regexp.QuoteMeta(prefix) + ")"
|
||||
}
|
||||
if _, hasIt := filters["$and"]; !hasIt {
|
||||
filters["$and"] = make([]bson.M, 0)
|
||||
|
||||
Reference in New Issue
Block a user