Added function to sanitize strings by escaping quotes (#2360)
This commit is contained in:
@@ -205,3 +205,9 @@ func DownloadUrl(ctx context.Context, httpClient *http.Client, url string, local
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func EscapeQuotes(str string) string {
|
||||
replacer := strings.NewReplacer("\n", "", "\r", "", "\t", "", `"`, `\"`)
|
||||
str = replacer.Replace(str)
|
||||
return str
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user