Pick d85a4e5ec2 for release branch

This commit is contained in:
Michael Buckley 2021-08-04 16:34:48 -04:00
parent 66e1f10f5f
commit e8e49f3ffa
1 changed files with 10 additions and 3 deletions

View File

@ -1056,7 +1056,13 @@ public class SearchBuilder implements ISearchBuilder {
for (String nextParamName : comboParamNames) {
List<List<IQueryParameterType>> nextValues = theParams.get(nextParamName);
nextParamName = UrlUtil.escapeUrlParam(nextParamName);
// TODO Hack to fix weird IOOB on the next stanza until James comes back and makes sense of this.
if (nextValues.isEmpty()) {
ourLog.error("query parameter {} is unexpectedly empty. Encountered while considering {} index for {}", nextParamName, comboParam.getName(), theRequest.getCompleteUrl());
sb = null;
break;
}
if (nextValues.get(0).size() != 1) {
sb = null;
break;
@ -1083,14 +1089,15 @@ public class SearchBuilder implements ISearchBuilder {
}
}
nextOrValue = UrlUtil.escapeUrlParam(nextOrValue);
if (first) {
first = false;
} else {
sb.append('&');
}
nextParamName = UrlUtil.escapeUrlParam(nextParamName);
nextOrValue = UrlUtil.escapeUrlParam(nextOrValue);
sb.append(nextParamName).append('=').append(nextOrValue);
}