Skip to content

Commit

Permalink
Fix XmlDataConnection (#3346)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink committed Aug 2, 2024
1 parent 637e764 commit c68d90f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if NETFRAMEWORK
Expand Down Expand Up @@ -96,13 +96,15 @@ public XmlDataConnection(string fileName, List<string> dataFolders)
Locale = CultureInfo.CurrentCulture,
};
string path = FixPath(_fileName) ?? Path.GetFullPath(_fileName);

// ReadXmlSchema and ReadXml should use the overload with XmlReader to avoid DTD processing
if (schemaOnly)
{
dataSet.ReadXmlSchema(path);
dataSet.ReadXmlSchema(new XmlTextReader(path));
}
else
{
dataSet.ReadXml(path);
dataSet.ReadXml(new XmlTextReader(path));
}

return dataSet;
Expand Down

0 comments on commit c68d90f

Please sign in to comment.