mirror of https://github.com/daffainfo/nuclei.git
Merge pull request #953 from projectdiscovery/bugfix-dsl-helper-trim
Fixing some DSL helpers logicdev
commit
3f73e1561d
|
@ -52,7 +52,7 @@ var functions = map[string]govaluate.ExpressionFunction{
|
||||||
return compiled.ReplaceAllString(types.ToString(args[0]), types.ToString(args[2])), nil
|
return compiled.ReplaceAllString(types.ToString(args[0]), types.ToString(args[2])), nil
|
||||||
},
|
},
|
||||||
"trim": func(args ...interface{}) (interface{}, error) {
|
"trim": func(args ...interface{}) (interface{}, error) {
|
||||||
return strings.Trim(types.ToString(args[0]), types.ToString(args[2])), nil
|
return strings.Trim(types.ToString(args[0]), types.ToString(args[1])), nil
|
||||||
},
|
},
|
||||||
"trimleft": func(args ...interface{}) (interface{}, error) {
|
"trimleft": func(args ...interface{}) (interface{}, error) {
|
||||||
return strings.TrimLeft(types.ToString(args[0]), types.ToString(args[1])), nil
|
return strings.TrimLeft(types.ToString(args[0]), types.ToString(args[1])), nil
|
||||||
|
@ -162,7 +162,7 @@ var functions = map[string]govaluate.ExpressionFunction{
|
||||||
base := letters + numbers
|
base := letters + numbers
|
||||||
|
|
||||||
if len(args) >= 1 {
|
if len(args) >= 1 {
|
||||||
l = args[0].(int)
|
l = int(args[0].(float64))
|
||||||
}
|
}
|
||||||
if len(args) >= withCutSetArgsSize {
|
if len(args) >= withCutSetArgsSize {
|
||||||
bad = types.ToString(args[1])
|
bad = types.ToString(args[1])
|
||||||
|
@ -179,7 +179,7 @@ var functions = map[string]govaluate.ExpressionFunction{
|
||||||
chars := letters + numbers
|
chars := letters + numbers
|
||||||
|
|
||||||
if len(args) >= 1 {
|
if len(args) >= 1 {
|
||||||
l = args[0].(int)
|
l = int(args[0].(float64))
|
||||||
}
|
}
|
||||||
if len(args) >= withCutSetArgsSize {
|
if len(args) >= withCutSetArgsSize {
|
||||||
bad = types.ToString(args[1])
|
bad = types.ToString(args[1])
|
||||||
|
@ -193,7 +193,7 @@ var functions = map[string]govaluate.ExpressionFunction{
|
||||||
chars := letters
|
chars := letters
|
||||||
|
|
||||||
if len(args) >= 1 {
|
if len(args) >= 1 {
|
||||||
l = args[0].(int)
|
l = int(args[0].(float64))
|
||||||
}
|
}
|
||||||
if len(args) >= withCutSetArgsSize {
|
if len(args) >= withCutSetArgsSize {
|
||||||
bad = types.ToString(args[1])
|
bad = types.ToString(args[1])
|
||||||
|
@ -207,7 +207,7 @@ var functions = map[string]govaluate.ExpressionFunction{
|
||||||
chars := numbers
|
chars := numbers
|
||||||
|
|
||||||
if len(args) >= 1 {
|
if len(args) >= 1 {
|
||||||
l = args[0].(int)
|
l = int(args[0].(float64))
|
||||||
}
|
}
|
||||||
if len(args) >= withCutSetArgsSize {
|
if len(args) >= withCutSetArgsSize {
|
||||||
bad = types.ToString(args[1])
|
bad = types.ToString(args[1])
|
||||||
|
|
Loading…
Reference in New Issue