mirror of https://github.com/daffainfo/nuclei.git
Merge branch 'bolli95-master'
commit
556a0b23fe
|
@ -47,7 +47,11 @@ func HelperFunctions() (functions map[string]govaluate.ExpressionFunction) {
|
||||||
}
|
}
|
||||||
|
|
||||||
functions["replace"] = func(args ...interface{}) (interface{}, error) {
|
functions["replace"] = func(args ...interface{}) (interface{}, error) {
|
||||||
return strings.ReplaceAll(args[0].(string), args[1].(string), args[2].(string)), nil
|
compiled, err := regexp.Compile(args[1].(string))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return compiled.ReplaceAllString(args[0].(string), args[2].(string)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
functions["trim"] = func(args ...interface{}) (interface{}, error) {
|
functions["trim"] = func(args ...interface{}) (interface{}, error) {
|
||||||
|
|
Loading…
Reference in New Issue