Skip to content
Merged
10 changes: 6 additions & 4 deletions core/src/org/labkey/core/admin/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -11222,10 +11222,12 @@ public void setExistingValue(String existingValue)
_existingValue = existingValue;
}

public String getExistingValues()
public List<String> getExistingValues()
{
// The JSP JavaScript delimits with "\n". Not sure where these "\r"s are coming from, but we need to strip them.
return _existingValues.replace("\r", "");
return Arrays.stream(StringUtils.trimToEmpty(_existingValues).split("\n"))
.map(String::trim)
.filter(s -> !s.isEmpty())
.toList();
}

@SuppressWarnings("unused")
Expand All @@ -11252,7 +11254,7 @@ private AllowedHost getAllowedHost(String value, BindException errors)

private List<AllowedHost> getExistingAllowedHosts(BindException errors)
{
List<AllowedHost> existing = Arrays.stream(getExistingValues().split("\n"))
List<AllowedHost> existing = getExistingValues().stream()
.map(value-> getAllowedHost(value, errors))
.toList();

Expand Down