Skip to content

Commit 977ddef

Browse files
committed
Merge branch '7.10' of github.com:gchq/stroom
2 parents 590566c + 31edc49 commit 977ddef

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ DO NOT ADD CHANGES HERE - ADD THEM USING log_change.sh
1313
~~~
1414

1515

16+
* Issue **#5100** : Fix selection filters auto quoting parameter replacements.
17+
1618
* Issue **#5318** : Fix Plan B session condensation.
1719

1820
* Issue **#5288** : Fix config defaults for `ForwardHttpPostConfig` and `HttpClientConfiguration`.

stroom-core-client/src/test/java/stroom/util/client/TestParamUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,14 @@ void testReplacement() {
8383
assertThat(result).isEqualTo("this is $$$value1 value2");
8484

8585
result = ParamUtil.replaceParameters("this is \"${key1}\" ${key2}", paramValues);
86-
assertThat(result).isEqualTo("this is \"${key1}\" value2");
86+
assertThat(result).isEqualTo("this is ${key1} value2");
8787

8888
paramValues = new ParamValuesImpl(getMap("user=\"user1 user2\""));
8989
result = ParamUtil.replaceParameters("${user}", paramValues);
90+
assertThat(result).isEqualTo("user1 user2");
91+
92+
paramValues = new ParamValuesImpl(getMap("user=\"user1 user2\""));
93+
result = ParamUtil.replaceParameters("'\\''${user}'\\''", paramValues);
9094
assertThat(result).isEqualTo("'user1 user2'");
9195
}
9296

stroom-query/stroom-query-api/src/main/java/stroom/query/api/ParamUtil.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,22 @@ public static String replaceParameters(final String value,
143143

144144
final String paramValue = paramValues.getParamValue(key);
145145
if (paramValue != null) {
146-
if (containsWhitespace(paramValue)) {
147-
sb.append("'");
148-
sb.append(paramValue);
149-
sb.append("'");
150-
} else {
151-
sb.append(paramValue);
152-
}
146+
// gh-5100 WE DO NOT WANT TO AUTOMATICALLY QUOTE REPLACED PARAMS, QUOTES SHOULD BE ADDED TO QUERIES
147+
// IF NEEDED
148+
// if (containsWhitespace(paramValue)) {
149+
// sb.append("'");
150+
// sb.append(paramValue);
151+
// sb.append("'");
152+
// } else {
153+
sb.append(paramValue);
154+
// }
153155
} else if (defaultValue != null) {
154156
sb.append(defaultValue);
155157
} else if (keepUnmatched) {
156-
sb.append(token.getText());
158+
sb.append(token.getUnescapedText());
157159
}
158160
} else {
159-
sb.append(token.getText());
161+
sb.append(token.getUnescapedText());
160162
}
161163
}
162164

0 commit comments

Comments
 (0)