2022-01-31 02:25:14 +01:00
|
|
|
package engine
|
|
|
|
|
|
|
|
|
|
import (
|
2025-02-10 21:46:35 +07:00
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/expressions"
|
2023-10-17 17:44:13 +05:30
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/marker"
|
2022-01-31 02:25:14 +01:00
|
|
|
"github.com/valyala/fasttemplate"
|
|
|
|
|
)
|
|
|
|
|
|
2025-02-10 21:46:35 +07:00
|
|
|
// replaceWithValues replaces the template markers with the values
|
|
|
|
|
//
|
|
|
|
|
// Deprecated: Not used anymore.
|
|
|
|
|
// nolint: unused
|
2022-01-31 02:25:14 +01:00
|
|
|
func replaceWithValues(data string, values map[string]interface{}) string {
|
|
|
|
|
return fasttemplate.ExecuteStringStd(data, marker.ParenthesisOpen, marker.ParenthesisClose, values)
|
|
|
|
|
}
|
2025-02-10 21:46:35 +07:00
|
|
|
|
|
|
|
|
func getExpressions(data string, values map[string]interface{}) []string {
|
|
|
|
|
return expressions.FindExpressions(data, marker.ParenthesisOpen, marker.ParenthesisClose, values)
|
|
|
|
|
}
|