Changeset 16606 in josm for trunk/src


Ignore:
Timestamp:
2020-06-11T20:03:41+02:00 (4 years ago)
Author:
simon04
Message:

see #19320 - Fix URL encoding for taghistory.raifer.tech

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TaginfoAction.java

    r16604 r16606  
    7474            if (tagTable.getSelectedRowCount() == 1) {
    7575                final int row = tagTable.getSelectedRow();
    76                 final String key = Utils.encodeUrl(tagKeySupplier.apply(row)).replaceAll("\\+", "%20");
     76                final String key = tagKeySupplier.apply(row);
    7777                Map<String, Integer> values = tagValuesSupplier.apply(row);
    7878                String value = values.size() == 1 ? values.keySet().iterator().next() : null;
     
    112112    public String getTaginfoUrlForTag(Tag tag) {
    113113        if (tag.getValue().isEmpty()) {
    114             return taginfoUrl + "/keys/" + tag.getKey();
     114            return taginfoUrl + "/keys/" + encodeKeyValue(tag.getKey());
    115115        } else {
    116             return taginfoUrl + "/tags/" + tag.getKey() + '=' + Utils.encodeUrl(tag.getValue()).replaceAll("\\+", "%20");
     116            return taginfoUrl + "/tags/" + encodeKeyValue(tag.getKey()) + '=' + encodeKeyValue(tag.getValue());
    117117        }
     118    }
     119
     120    private static String encodeKeyValue(String string) {
     121        return Utils.encodeUrl(string).replaceAll("\\+", "%20");
    118122    }
    119123
Note: See TracChangeset for help on using the changeset viewer.