@cryptotaxi247 / netdata-1 / commits / a1c1f8f3a

fix: allow square brackets in label value (#15131)

Ilya Mashchenko committed Jun 1, 2023 at 20:40 UTC a1c1f8f3abc1fd547f4996dee2d2ee587b98c0c3
1 file changed +3 -2
database/rrdlabels.c
+3 -2
@@ -153,9 +153,9 @@ static unsigned char label_values_char_map[256] = {
153 [88] = 'X', // X keep
154 [89] = 'Y', // Y keep
155 [90] = 'Z', // Z keep
156 - [91] = '_', // [
156 + [91] = '[', // [ keep
157 [92] = '/', // backslash convert \ to /
158 - [93] = '_', // ]
158 + [93] = ']', // ] keep
159 [94] = '_', // ^
160 [95] = '_', // _ keep
161 [96] = '_', // `
@@ -1223,6 +1223,7 @@ int rrdlabels_unittest_sanitization() {
1223 errors += rrdlabels_unittest_sanitize_value("", "[none]");
1224 errors += rrdlabels_unittest_sanitize_value("1", "1");
1225 errors += rrdlabels_unittest_sanitize_value(" hello world ", "hello world");
1226 + errors += rrdlabels_unittest_sanitize_value("[none]", "[none]");
1227
1228 // 2-byte UTF-8
1229 errors += rrdlabels_unittest_sanitize_value(" Ελλάδα ", "Ελλάδα");