From 8ff051b287a5727ee3ed616dcac1fd3b94238136 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 17 Jul 2024 13:00:56 +0200 Subject: [PATCH] lib/protoparser/graphite: use Regex.ReplaceAllLiteralString instead of Regex.ReplaceAllString for the case when the replacement cannot contain placeholders for capturing groups This is a follow-up for 74affa3aecd769ef94cc4f50774c1759518d8619 --- lib/protoparser/graphite/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protoparser/graphite/parser.go b/lib/protoparser/graphite/parser.go index b046955c7..74aa18a7d 100644 --- a/lib/protoparser/graphite/parser.go +++ b/lib/protoparser/graphite/parser.go @@ -257,7 +257,7 @@ func stripLeadingWhitespace(s string) string { var sanitizer = bytesutil.NewFastStringTransformer(func(s string) string { // Apply rule to drop some chars to preserve backwards compatibility - s = repeatedDots.ReplaceAllString(s, ".") + s = repeatedDots.ReplaceAllLiteralString(s, ".") // Replace any remaining illegal chars return allowedChars.ReplaceAllLiteralString(s, "_")