diff options
author | PJ Fanning <fanningpj@apache.org> | 2017-06-24 07:30:07 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2017-06-24 07:30:07 +0000 |
commit | 6df937ec6bde5aad5dbcd9cbc558cc623b24a406 (patch) | |
tree | 645f0b69eb2610f93fd74d60963794c1f8170c5b /src/java/org/apache/poi/sl/draw | |
parent | 3e6d942b958744d78900efd9eb923cbbd190a73a (diff) | |
download | poi-6df937ec6bde5aad5dbcd9cbc558cc623b24a406.tar.gz poi-6df937ec6bde5aad5dbcd9cbc558cc623b24a406.zip |
Add StaxHelper to ensure that StAX parsers have sensible defaults, including settings to avoid XML Entity Expansion issues
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799734 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/sl/draw')
-rw-r--r-- | src/java/org/apache/poi/sl/draw/DrawSimpleShape.java | 3 | ||||
-rw-r--r-- | src/java/org/apache/poi/sl/draw/geom/PresetGeometries.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java b/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java index d2e9991e1e..912cf3e7a0 100644 --- a/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java +++ b/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java @@ -53,6 +53,7 @@ import org.apache.poi.sl.usermodel.PaintStyle.SolidPaint; import org.apache.poi.sl.usermodel.Shadow; import org.apache.poi.sl.usermodel.SimpleShape; import org.apache.poi.util.IOUtils; +import org.apache.poi.util.StaxHelper; import org.apache.poi.util.Units; @@ -363,7 +364,7 @@ public class DrawSimpleShape extends DrawShape { }; try { - XMLInputFactory staxFactory = XMLInputFactory.newInstance(); + XMLInputFactory staxFactory = StaxHelper.newXMLInputFactory(); XMLEventReader staxReader = staxFactory.createXMLEventReader(presetIS); XMLEventReader staxFiltRd = staxFactory.createFilteredReader(staxReader, startElementFilter); // Ignore StartElement: diff --git a/src/java/org/apache/poi/sl/draw/geom/PresetGeometries.java b/src/java/org/apache/poi/sl/draw/geom/PresetGeometries.java index ad2553fbe7..a188e6e255 100644 --- a/src/java/org/apache/poi/sl/draw/geom/PresetGeometries.java +++ b/src/java/org/apache/poi/sl/draw/geom/PresetGeometries.java @@ -37,6 +37,7 @@ import javax.xml.stream.events.XMLEvent; import org.apache.poi.sl.draw.binding.CTCustomGeometry2D; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; +import org.apache.poi.util.StaxHelper; /** * @@ -59,7 +60,7 @@ public class PresetGeometries extends LinkedHashMap<String, CustomGeometry> { } }; - XMLInputFactory staxFactory = XMLInputFactory.newFactory(); + XMLInputFactory staxFactory = StaxHelper.newXMLInputFactory(); XMLEventReader staxReader = staxFactory.createXMLEventReader(is); XMLEventReader staxFiltRd = staxFactory.createFilteredReader(staxReader, startElementFilter); // ignore StartElement: |