Ignore:
Timestamp:
2014-01-30T18:02:53+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9647 - filter invalid XML characters in changeset API responses

File:
1 edited

Legend:

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

    r6716 r6787  
    8787        return getInputStreamRaw(urlStr, progressMonitor, null);
    8888    }
    89    
     89
    9090    /**
    9191     * Open a connection to the given url and return a reader on the input stream
     
    151151                    String errorHeader = activeConnection.getHeaderField("Error");
    152152                    StringBuilder errorBody = new StringBuilder();
    153                     try
    154                     {
    155                         InputStream i = FixEncoding(activeConnection.getErrorStream(), encoding);
     153                    try {
     154                        InputStream i = fixEncoding(activeConnection.getErrorStream(), encoding);
    156155                        if (i != null) {
    157156                            BufferedReader in = new BufferedReader(new InputStreamReader(i));
     
    170169                }
    171170
    172                 return FixEncoding(new ProgressInputStream(activeConnection, progressMonitor), encoding);
     171                return fixEncoding(new ProgressInputStream(activeConnection, progressMonitor), encoding);
    173172            } catch (OsmTransferException e) {
    174173                throw e;
     
    181180    }
    182181
    183     private InputStream FixEncoding(InputStream stream, String encoding) throws IOException
    184     {
     182    private InputStream fixEncoding(InputStream stream, String encoding) throws IOException {
    185183        if ("gzip".equalsIgnoreCase(encoding)) {
    186184            stream = new GZIPInputStream(stream);
    187         }
    188         else if ("deflate".equalsIgnoreCase(encoding)) {
     185        } else if ("deflate".equalsIgnoreCase(encoding)) {
    189186            stream = new InflaterInputStream(stream, new Inflater(true));
    190187        }
Note: See TracChangeset for help on using the changeset viewer.