-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[X] Protect some xmlns #28909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[X] Protect some xmlns #28909
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
@@ -336,16 +336,24 @@ static IValueNode GetValueNode(object value, XmlReader reader) | |||
static void GatherXmlnsDefinitionAttributes() | |||
{ | |||
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); | |||
s_xmlnsDefinitions = new List<XmlnsDefinitionAttribute>(); | |||
s_xmlnsDefinitions = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using [] to initialize s_xmlnsDefinitions is not valid in C#. Please replace it with a proper List initialization, e.g., 'new List();'.
s_xmlnsDefinitions = []; | |
s_xmlnsDefinitions = new List<XmlnsDefinitionAttribute>(); |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try the latest c# Mr AI
protect maui and x: xmlns from overloading. - fixes #28836
ddcb498
to
6613043
Compare
😉 |
@@ -26,14 +27,24 @@ static IList<XmlnsDefinitionAttribute> GatherXmlnsDefinitionAttributes(ModuleDef | |||
if (ca.AttributeType.FullName == typeof(XmlnsDefinitionAttribute).FullName) | |||
{ | |||
var attr = GetXmlnsDefinition(ca, asmDef); | |||
//maui, and x: xmlns are protected | |||
if (attr.XmlNamespace.StartsWith("http://schemas.microsoft.com/", StringComparison.OrdinalIgnoreCase) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would using https://
instead of http://
allow me to bypass this check?
I'm not exactly sure if this is supposed to be a hard check or a soft check.
Description of Change
[X] Protect some xmlns
protect maui and x: xmlns from overloading.
Issues Fixed