fix #2817 Update site_path abbreviation logic based on configuration settings.

This commit is contained in:
Shinsuke Sugaya 2024-05-30 15:58:45 +09:00
parent 020115648f
commit 2f4f0d8cd6

View file

@ -636,10 +636,11 @@ public class ViewHelper {
if (siteValue != null) {
final String site = siteValue.toString();
final int size = fessConfig.getResponseMaxSitePathLengthAsInteger();
if (size > -1) {
if (size > 3) {
return StringUtils.abbreviate(site, size);
} else if (size >= 0) {
return site;
}
return site;
}
final Object urlLink = docMap.get(fessConfig.getResponseFieldUrlLink());
if (urlLink != null) {
@ -653,7 +654,7 @@ public class ViewHelper {
returnUrl = url.replaceFirst("^[a-zA-Z0-9]*:/+", "");
}
final int size = fessConfig.getResponseMaxSitePathLengthAsInteger();
if (size > -1) {
if (size > 3) {
return StringUtils.abbreviate(returnUrl, size);
}
return returnUrl;