disable DTD reading.
This commit is contained in:
Scott Battaglia 2011-10-31 02:44:07 +00:00
parent 80693a3db9
commit a19c27f75b
1 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,9 @@ public final class XmlUtils {
*/
public static XMLReader getXmlReader() {
try {
return XMLReaderFactory.createXMLReader();
final XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
return reader;
} catch (final SAXException e) {
throw new RuntimeException("Unable to create XMLReader", e);
}