From e70d0bee5b4f0b3ab9ad6d63a8470e8f99a201f9 Mon Sep 17 00:00:00 2001 From: Luc Talatinian Date: Mon, 22 Jan 2024 11:55:05 -0500 Subject: [PATCH] fix: remove invalid escaping of shared config values --- .changelog/3d35583634994f17915c859ae0c1f0f4.json | 10 ++++++++++ internal/ini/strings.go | 4 ---- internal/ini/testdata/valid/escaped_profile | 3 --- internal/ini/testdata/valid/escaped_profile_expected | 6 ------ 4 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 .changelog/3d35583634994f17915c859ae0c1f0f4.json delete mode 100644 internal/ini/testdata/valid/escaped_profile delete mode 100644 internal/ini/testdata/valid/escaped_profile_expected diff --git a/.changelog/3d35583634994f17915c859ae0c1f0f4.json b/.changelog/3d35583634994f17915c859ae0c1f0f4.json new file mode 100644 index 00000000000..298dd8bf10e --- /dev/null +++ b/.changelog/3d35583634994f17915c859ae0c1f0f4.json @@ -0,0 +1,10 @@ +{ + "id": "3d355836-3499-4f17-915c-859ae0c1f0f4", + "type": "bugfix", + "description": "Remove invalid escaping of shared config values. All values in the shared config file will now be interpreted literally, save for fully-quoted strings which are unwrapped for legacy reasons.", + "modules": [ + ".", + "config", + "internal/ini" + ] +} \ No newline at end of file diff --git a/internal/ini/strings.go b/internal/ini/strings.go index 661588c2276..ed77d083517 100644 --- a/internal/ini/strings.go +++ b/internal/ini/strings.go @@ -67,12 +67,8 @@ func unquote(s string) string { // applies various legacy conversions to property values: // - remote wrapping single/doublequotes -// - expand escaped quote and newline sequences func legacyStrconv(s string) string { s = unquote(s) - s = strings.ReplaceAll(s, `\"`, `"`) - s = strings.ReplaceAll(s, `\'`, `'`) - s = strings.ReplaceAll(s, `\n`, "\n") return s } diff --git a/internal/ini/testdata/valid/escaped_profile b/internal/ini/testdata/valid/escaped_profile deleted file mode 100644 index b3df9972171..00000000000 --- a/internal/ini/testdata/valid/escaped_profile +++ /dev/null @@ -1,3 +0,0 @@ -[ default ] -foo = "\"bar\"" -baz = "qux\n" diff --git a/internal/ini/testdata/valid/escaped_profile_expected b/internal/ini/testdata/valid/escaped_profile_expected deleted file mode 100644 index 914d6860198..00000000000 --- a/internal/ini/testdata/valid/escaped_profile_expected +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": { - "foo": "\"bar\"", - "baz": "qux\n" - } -}