Ticket #19097: 19097.patch
| File 19097.patch, 1.5 KB (added by , 6 years ago) |
|---|
-
src/org/openstreetmap/josm/tools/ImageProvider.java
64 64 import javax.swing.ImageIcon; 65 65 import javax.xml.parsers.ParserConfigurationException; 66 66 67 import com.kitfox.svg.SVGDiagram;68 import com.kitfox.svg.SVGException;69 import com.kitfox.svg.SVGUniverse;70 67 import org.openstreetmap.josm.data.Preferences; 71 68 import org.openstreetmap.josm.data.osm.DataSet; 72 69 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 90 87 import org.xml.sax.XMLReader; 91 88 import org.xml.sax.helpers.DefaultHandler; 92 89 90 import com.kitfox.svg.SVGDiagram; 91 import com.kitfox.svg.SVGException; 92 import com.kitfox.svg.SVGUniverse; 93 93 94 /** 94 95 * Helper class to support the application with images. 95 96 * … … 1016 1017 String mediatype = m.group(1); 1017 1018 if ("image/svg+xml".equals(mediatype)) { 1018 1019 String s = new String(bytes, StandardCharsets.UTF_8); 1020 // see #19097: check if s starts with PNG magic 1021 if (s.length() > 4 && "PNG".equals(s.substring(1, 4))) { 1022 Logging.warn("url contains PNG file " + url); 1023 return null; 1024 } 1019 1025 SVGDiagram svg; 1020 1026 synchronized (getSvgUniverse()) { 1021 1027 URI uri = getSvgUniverse().loadSVG(new StringReader(s), Utils.encodeUrl(s));
