Ignore:
Timestamp:
2016-03-26T21:49:06+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #12675 - fix XML encoding of user names in changeset requests

Location:
trunk/src/org/openstreetmap/josm/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r10000 r10051  
    281281     * @return XML string
    282282     */
    283     private String toXml(IPrimitive o, boolean addBody) {
     283    protected final String toXml(IPrimitive o, boolean addBody) {
    284284        StringWriter swriter = new StringWriter();
    285285        try (OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(swriter), true, version)) {
     
    302302     * @return XML string
    303303     */
    304     private String toXml(Changeset s) {
     304    protected final String toXml(Changeset s) {
    305305        StringWriter swriter = new StringWriter();
    306306        try (OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(swriter), true, version)) {
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r9970 r10051  
    239239
    240240    public void visit(Changeset cs) {
    241         out.print("  <changeset ");
    242         out.print(" id='"+cs.getId()+'\'');
     241        out.print("  <changeset id='"+cs.getId()+'\'');
    243242        if (cs.getUser() != null) {
    244             out.print(" user='"+cs.getUser().getName() +'\'');
     243            out.print(" user='"+ XmlWriter.encode(cs.getUser().getName()) +'\'');
    245244            out.print(" uid='"+cs.getUser().getId() +'\'');
    246245        }
Note: See TracChangeset for help on using the changeset viewer.