Changeset 12420 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2017-06-21T22:05:15+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #14956 - wrong link to taginfo if key/value contains space character

File:
1 edited

Legend:

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

    r12279 r12420  
    12311231            if (tagTable.getSelectedRowCount() == 1) {
    12321232                final int row = tagTable.getSelectedRow();
    1233                 final String key = Utils.encodeUrl(editHelper.getDataKey(row));
     1233                final String key = Utils.encodeUrl(editHelper.getDataKey(row)).replaceAll("\\+", "%20");
    12341234                Map<String, Integer> values = editHelper.getDataValues(row);
    12351235                if (values.size() == 1) {
    1236                     url = TAGINFO_URL_PROP.get() + "tags/" + key /* do not URL encode key, otherwise addr:street does not work */
    1237                             + '=' + Utils.encodeUrl(values.keySet().iterator().next());
     1236                    url = TAGINFO_URL_PROP.get() + "tags/" + key
     1237                            + '=' + Utils.encodeUrl(values.keySet().iterator().next()).replaceAll("\\+", "%20");
    12381238                } else {
    1239                     url = TAGINFO_URL_PROP.get() + "keys/" + key; /* do not URL encode key, otherwise addr:street does not work */
     1239                    url = TAGINFO_URL_PROP.get() + "keys/" + key;
    12401240                }
    12411241            } else if (membershipTable.getSelectedRowCount() == 1) {
Note: See TracChangeset for help on using the changeset viewer.