Changeset 10051 in josm


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

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

Location:
trunk
Files:
1 added
4 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        }
  • trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTest.java

    r10019 r10051  
    2020    /**
    2121     * Setup test.
    22      * @throws IOException in case of I/O error
    2322     */
    2423    @BeforeClass
    25     public static void setUp() throws IOException {
     24    public static void setUp() {
    2625        JOSMFixture.createUnitTestFixture().init();
    2726    }
  • trunk/test/unit/org/openstreetmap/josm/io/NoteImporterTest.java

    r9797 r10051  
    1818    /**
    1919     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/12531">Bug #12531</a>.
    20      * @throws Exception if any error occurs
    2120     */
    2221    @Test
    23     public void testTicket12531() throws Exception {
     22    public void testTicket12531() {
    2423        assertNull(Main.map);
    2524        assertTrue(new NoteImporter().importDataHandleExceptions(
Note: See TracChangeset for help on using the changeset viewer.