From: Aurelien Poscia Date: Wed, 10 Aug 2022 12:26:39 +0000 (+0200) Subject: SONAR-17150 fix SSF-39 X-Git-Tag: 9.6.0.59041~49 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7ba75fc70e31b32bc46f6cc0f4ec631ff19254d4;p=sonarqube.git SONAR-17150 fix SSF-39 --- diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/language/ws/ListAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/language/ws/ListAction.java index 5552ed21c73..e26d2765cae 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/language/ws/ListAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/language/ws/ListAction.java @@ -81,11 +81,11 @@ public class ListAction implements WsAction { } private Collection listMatchingLanguages(@Nullable String query, int pageSize) { - Pattern pattern = Pattern.compile(query == null ? MATCH_ALL : MATCH_ALL + Pattern.quote(query) + MATCH_ALL, Pattern.CASE_INSENSITIVE); + Pattern pattern = Pattern.compile(query == null ? MATCH_ALL : Pattern.quote(query), Pattern.CASE_INSENSITIVE); SortedMap languagesByName = Maps.newTreeMap(); for (Language lang : languages.all()) { - if (pattern.matcher(lang.getKey()).matches() || pattern.matcher(lang.getName()).matches()) { + if (pattern.matcher(lang.getKey()).find() || pattern.matcher(lang.getName()).find()) { languagesByName.put(lang.getName(), lang); } }