From: <udi...@us...> - 2022-01-17 13:59:40
|
Revision: 1428 http://sourceforge.net/p/j-trac/code/1428 Author: udittmer Date: 2022-01-17 13:59:38 +0000 (Mon, 17 Jan 2022) Log Message: ----------- handle base URLs correctly whether they end with a {U+201C}/{U+201C} or not Modified Paths: -------------- trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java Modified: trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java =================================================================== --- trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2022-01-12 19:44:50 UTC (rev 1427) +++ trunk/jtrac/src/main/java/info/jtrac/util/ItemUtils.java 2022-01-17 13:59:38 UTC (rev 1428) @@ -159,9 +159,14 @@ if (text == null) { return null; } else { + if (baseUrl == null) + baseUrl = "/"; + if (! baseUrl.endsWith("/")) + baseUrl += "/"; + for (Space space : spaces) { text = text.replaceAll("(?i)(?<!/)"+space.getPrefixCode()+"-[0-9]+", - "<a href='"+(baseUrl==null ? "/" : baseUrl)+"app/item/$0' target='_blank'>$0</a>"); + "<a href='"+baseUrl+"app/item/$0' target='_blank'>$0</a>"); } return text; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |