|
145 | 145 | import org.apache.commons.io.FileUtils;
|
146 | 146 | import org.apache.commons.io.FilenameUtils;
|
147 | 147 | import org.apache.commons.io.IOUtils;
|
148 |
| -import org.apache.commons.lang.StringUtils; |
149 | 148 | import org.apache.commons.logging.LogFactory;
|
150 | 149 | import org.jenkinsci.Symbol;
|
151 | 150 | import org.jvnet.hudson.reactor.Executable;
|
@@ -1436,13 +1435,13 @@ public HttpResponse doPluginsSearch(@QueryParameter String query, @QueryParamete
|
1436 | 1435 | if (query == null || query.isBlank()) {
|
1437 | 1436 | return true;
|
1438 | 1437 | }
|
1439 |
| - return StringUtils.containsIgnoreCase(plugin.name, query) || |
1440 |
| - StringUtils.containsIgnoreCase(plugin.title, query) || |
1441 |
| - StringUtils.containsIgnoreCase(plugin.excerpt, query) || |
| 1438 | + return (plugin.name != null && plugin.name.toLowerCase().contains(query.toLowerCase())) || |
| 1439 | + (plugin.title != null && plugin.title.toLowerCase().contains(query.toLowerCase())) || |
| 1440 | + (plugin.excerpt != null && plugin.excerpt.toLowerCase().contains(query.toLowerCase())) || |
1442 | 1441 | plugin.hasCategory(query) ||
|
1443 | 1442 | plugin.getCategoriesStream()
|
1444 | 1443 | .map(UpdateCenter::getCategoryDisplayName)
|
1445 |
| - .anyMatch(category -> StringUtils.containsIgnoreCase(category, query)) || |
| 1444 | + .anyMatch(category -> category != null && category.toLowerCase().contains(query.toLowerCase())) || |
1446 | 1445 | plugin.hasWarnings() && query.equalsIgnoreCase("warning:");
|
1447 | 1446 | })
|
1448 | 1447 | .limit(Math.max(limit - plugins.size(), 1))
|
@@ -1472,7 +1471,7 @@ public HttpResponse doPluginsSearch(@QueryParameter String query, @QueryParamete
|
1472 | 1471 | jsonObject.put("title", plugin.title);
|
1473 | 1472 | jsonObject.put("displayName", plugin.getDisplayName());
|
1474 | 1473 | if (plugin.wiki == null || !(plugin.wiki.startsWith("https://") || plugin.wiki.startsWith("http://"))) {
|
1475 |
| - jsonObject.put("wiki", StringUtils.EMPTY); |
| 1474 | + jsonObject.put("wiki", ""); |
1476 | 1475 | } else {
|
1477 | 1476 | jsonObject.put("wiki", plugin.wiki);
|
1478 | 1477 | }
|
|
0 commit comments