未验证 提交 bdb3ece7 编写于 作者: J Jason Malinowski 提交者: GitHub

Merge pull request #41586 from jasonmalinowski/delete-suppressions-for-ca3053

Delete suppressions of CA3053
......@@ -54,12 +54,6 @@ private static bool ReadToChild(XmlReader reader, int depth, string elementName,
DtdProcessing = DtdProcessing.Prohibit,
};
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
However, the said XmlResolver property no longer exists in .NET portable framework (i.e. core framework) which means there is no way to set it.
So we suppress this error until the reporting for CA3053 has been updated to account for .NET portable framework.")]
internal static AssemblyPortabilityPolicy LoadFromXml(Stream input)
{
// Note: Unlike Fusion XML reader the XmlReader doesn't allow whitespace in front of <?xml version=""1.0"" encoding=""utf-8"" ?>
......
......@@ -44,12 +44,6 @@ public XDocument GetOrMakeDocument(string resolvedPath)
/// <exception cref="IOException"></exception>
/// <exception cref="XmlException"></exception>
/// <exception cref="InvalidOperationException"></exception>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
However, the said XmlResolver property no longer exists in .NET portable framework (i.e. core framework) which means there is no way to set it.
So we suppress this error until the reporting for CA3053 has been updated to account for .NET portable framework.")]
private static KeyValuePair<string, XDocument> MakeValue(XmlReferenceResolver resolver, string resolvedPath)
{
CacheMissCount++;
......
......@@ -32,12 +32,6 @@ public static XmlException ParseAndGetException(string text)
private static readonly XmlReaderSettings s_xmlSettings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Prohibit };
// internal for testing
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
However, the said XmlResolver property no longer exists in .NET portable framework (i.e. core framework) which means there is no way to set it.
So we suppress this error until the reporting for CA3053 has been updated to account for .NET portable framework.")]
internal XmlException ParseInternal(string text)
{
_textReader.SetText(text);
......
......@@ -54,12 +54,6 @@ internal class RuleSetProcessor
/// Creates and loads the rule set from a file
/// </summary>
/// <param name="filePath">The file path to load the rule set</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
However, the said XmlResolver property no longer exists in .NET portable framework (i.e. core framework) which means there is no way to set it.
So we suppress this error until the reporting for CA3053 has been updated to account for .NET portable framework.")]
public static RuleSet LoadFromFile(string filePath)
{
// First read the file without doing any validation
......
......@@ -52,12 +52,6 @@ public static void ParseFragment<TArg>(string xmlFragment, Action<XmlReader, TAr
DtdProcessing = DtdProcessing.Prohibit,
};
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
However, the said XmlResolver property no longer exists in .NET portable framework (i.e. core framework) which means there is no way to set it.
So we suppress this error until the reporting for CA3053 has been updated to account for .NET portable framework.")]
private void ParseInternal<TArg>(string text, Action<XmlReader, TArg> callback, TArg arg)
{
_textReader.SetText(text);
......
......@@ -56,12 +56,6 @@ public static XmlDocumentationProvider CreateFromFile(string xmlDocCommentFilePa
return new FileBasedXmlDocumentationProvider(xmlDocCommentFilePath);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = @"For the call to XmlReader.Create() below, CA3053 recommends setting the
XmlReaderSettings.XmlResolver property to either null or an instance of XmlSecureResolver.
However, the said XmlResolver property no longer exists in .NET portable framework (i.e. core framework) which means there is no way to set it.
So we suppress this error until the reporting for CA3053 has been updated to account for .NET portable framework.")]
private XDocument GetXDocument(CancellationToken cancellationToken)
{
using var stream = GetSourceStream(cancellationToken);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册