Skip to content

Commit

Permalink
fix #2817 Update site_path abbreviation logic based on configuration …
Browse files Browse the repository at this point in the history
…settings.
  • Loading branch information
marevol committed May 30, 2024
1 parent 0201156 commit 2f4f0d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/codelibs/fess/helper/ViewHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,11 @@ public Object getSitePath(final Map<String, Object> docMap) {
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) {
Expand All @@ -653,7 +654,7 @@ public Object getSitePath(final Map<String, Object> docMap) {
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;
Expand Down

0 comments on commit 2f4f0d8

Please sign in to comment.