Skip to content

Commit 99c44d3

Browse files
author
stoecker
committed
fix #24841 - proper encoding of URL parameters in Tag2Link
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19617 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 2e251f7 commit 99c44d3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/org/openstreetmap/josm/tools/Tag2Link.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ public static void getLinksForTag(String key, String value, LinkConsumer linkCon
214214
if (!formatterUrls.isEmpty()) {
215215
final String formattedValue = valueFormatter.getOrDefault(key, x -> x).apply(value);
216216

217-
final String urlKey = formatterUrls.stream().map(urlFormatter -> PATTERN_DOLLAR_ONE.matcher(urlFormatter)
217+
final String urlKey = Utils.encodeUrl(formatterUrls.stream().map(urlFormatter -> PATTERN_DOLLAR_ONE.matcher(urlFormatter)
218218
.replaceAll(Matcher.quoteReplacement("(.*)"))).map(PatternUtils::compile)
219219
.map(pattern -> pattern.matcher(value)).filter(Matcher::matches)
220-
.map(matcher -> matcher.group(1)).findFirst().orElse(formattedValue);
220+
.map(matcher -> matcher.group(1)).findFirst().orElse(formattedValue));
221221

222222
formatterUrls.forEach(urlFormatter -> {
223223
// Check if the current value matches the formatter pattern -- some keys can take a full url or a key for

0 commit comments

Comments
 (0)