-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Compat bug in System.ComponentModel.Annotations tests for validating PhoneAttributes #20884
Comments
Since we almost bought the code over verbatim, this is curious? |
@divega @lajones @ajcvickers can you please comment? Great catch @hughbe! Out of curiosity, how did you catch it? A new test you just added? Or did you do netfx test runs on your own? (in which case I would be curious why we missed it in our runs) |
I ran the netfx tests on my own:
I've submitted dotnet/corefx#17874 to get the tests passing, and fix #20883 @danmosemsft I suspect it's due to the PR feedback commit for the security bulletin fix that was copied verbatim from netfx: Or could've been when porting-to-core. There have only been a couple of changes to PhoneAttribute in corefx: https://github.com/dotnet/corefx/commits/master/src/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/PhoneAttribute.cs |
@karelz I assume we did/would catch it. We just didn't open al lthe desktop issues yet. |
Ah, I thought we're mostly done already. OK, that makes sense now. |
I agree with #20883, but this one worries me a bit more. We had very long discussions around the deliberate change to allow what were previously invalid phone numbers to appear as valid according to this attribute (along with similar discussions for |
This change was definitely by design because of concerns with the rather high degree of complexity of the regexes that were used, compared to the rather low value that they provide. Given that that change shipped some time ago, changing it again would of course be another breaking change and/or interop challenge. I personally much prefer the new behavior because it seems a lot closer to what a person would expect such a validation attribute to do The old attributes were more difficult to describe to a human. |
Sure - it's just a bit odd as I thought the .NET framework already had this hotfix so would have the same behaviour as .NET core. Let's close this then as by-design? |
The following phone numbers (obviously invalid) are valid with .NET core, and invalid with netfx.
On netfx: test passes
On netcoreapp: test fails
This regression was likely caused by dotnet/corefx#4319
I suggest this is triaged as a .NET core bug.
The text was updated successfully, but these errors were encountered: