Skip to content

Commit 1c9ac0a

Browse files
iText-CIEugene Bochilo
authored andcommitted
Allow overriding factory creations and safe configurations
DEVSIX-6759 Autoported commit. Original commit hash: [4848c163c] Manual files: kernel/src/main/java/com/itextpdf/kernel/utils/DefaultSafeXmlParserFactory.java
1 parent e5d41c1 commit 1c9ac0a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

itext/itext.kernel/itext/kernel/utils/DefaultSafeXmlParserFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public XmlReader CreateXmlReaderInstance(TextReader textReader)
6969
return XmlReader.Create(textReader, CreateSafeXmlReaderSettings());
7070
}
7171

72-
private static XmlReaderSettings CreateSafeXmlReaderSettings()
72+
/// <summary>
73+
/// Creates <see cref="XmlReaderSettings"/> to make reader secure against xml attacks.
74+
/// </summary>
75+
/// <returns>Configured xml reader settings</returns>
76+
protected virtual XmlReaderSettings CreateSafeXmlReaderSettings()
7377
{
7478
XmlReaderSettings xmlReaderSettings = new XmlReaderSettings {DtdProcessing = DtdProcessing.Prohibit};
7579
return xmlReaderSettings;

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
89de8b416485c6e009d341824fa83e2a941fceae
1+
db01ff7d1b00e8b056096a6db13c436b67a5d934

0 commit comments

Comments
 (0)