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


Ignore:
Timestamp:
2021-05-24T12:13:55+02:00 (3 years ago)
Author:
simon04
Message:

see #19771 - Tag2Link: use URL encoding for Wikimedia Commons URLs

Removes com.google.gdata.util.common.base.PercentEscaper dependency (provided via signpost-core)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Tag2Link.java

    r17736 r17909  
    2727import javax.json.JsonValue;
    2828
    29 import com.google.gdata.util.common.base.PercentEscaper;
    3029import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    3130import org.openstreetmap.josm.data.osm.OsmUtils;
     
    218217
    219218    private static String getWikimediaCommonsUrl(String i) {
    220         return "https://commons.wikimedia.org/wiki/" + new PercentEscaper(PercentEscaper.SAFEPATHCHARS_URLENCODER, false).escape(i);
     219        i = i.replace(' ', '_');
     220        i = Utils.encodeUrl(i);
     221        return "https://commons.wikimedia.org/wiki/" + i;
    221222    }
    222223
Note: See TracChangeset for help on using the changeset viewer.