A bugfix for CategoryComponent. In some cases the URL provided to CategoryComponent ends with a slash in others in doesn't. Both cases are now supported.

git-svn-id: https://svn.libreccm.org/ccm/trunk@5269 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2018-02-13 11:19:52 +00:00
parent 59a5764863
commit 631fb2367a
1 changed files with 16 additions and 7 deletions

View File

@ -66,12 +66,21 @@ public abstract class CategoryComponent extends AbstractComponent {
content.addAttribute("description", description); content.addAttribute("description", description);
if (CMSConfig.getInstanceOf().getUseLanguageExtension() if (CMSConfig.getInstanceOf().getUseLanguageExtension()
&& !url.startsWith("/redirect/")) { && !url.startsWith("/redirect/")) {
if (url.endsWith("/")) {
content.addAttribute("url", content.addAttribute("url",
String.format("%sindex.%s", String.format("%sindex.%s",
url, url,
GlobalizationHelper GlobalizationHelper
.getNegotiatedLocale() .getNegotiatedLocale()
.getLanguage())); .getLanguage()));
} else {
content.addAttribute("url",
String.format("%s/index.%s",
url,
GlobalizationHelper
.getNegotiatedLocale()
.getLanguage()));
}
} else { } else {
content.addAttribute("url", url); content.addAttribute("url", url);
} }