Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fixes xamarin-bug #8965: AllowHtmlAttribute ignored throwing exception on POST using ASP.NET mvc3 #524

Merged
merged 2 commits into from Feb 9, 2013

Conversation

Projects
None yet
3 participants
Contributor

pruiz commented Dec 16, 2012

Mono's implementation of Microsoft.Web.Infrastructure was (incorrectly)
applying validation over 'unvalidated collections' cause HttpRequest's
internal collection is being replaced by a new LazyWebROCollection
which internally performs validation inside it's Get() methods.

However, ValidationUtility.GetUnvalidatedCollections(..) should not
perform validation, as this is what MVC (when using AllowHtmlAttribute)
expects.

See: https://bugzilla.xamarin.com/show_bug.cgi?id=8965
License: This patch is under MIT/X11 license.

@pruiz pruiz Fixes xamarin-bug #8965: AllowHtmlAttribute ignored throwing exceptio…
…n on POST using ASP.NET mvc3

Mono's implementation of Microsoft.Web.Infrastructure was incorrectly
applying validation over 'unvalidated collections' cause HttpRequest's
internal collection is being replaced by a new LazyWebROCollection
which internally performs validation inside it's Get() methods.

However, ValidationUtility.GetUnvalidatedCollections(..) should not
perform validation, as this is what MVC (when using AllowHtmlAttribute)
expects.

See: https://bugzilla.xamarin.com/show_bug.cgi?id=8965
License: This patch is under MIT/X11 license.
cdc71ff

@Daniel15 Daniel15 commented on an outdated diff Dec 23, 2012

...tructure.DynamicValidationHelper/ValidationUtility.cs
@@ -43,6 +45,13 @@ public static void EnableDynamicValidation (HttpContext context)
if (req == null)
return;
+ // We migth get called more than once.. (weird, isnt it?)
@Daniel15

Daniel15 Dec 23, 2012

Contributor

There's a small typo here ("migth") :)

Contributor

pruiz commented Dec 26, 2012

Fixed, thnks @Daniel15

@migueldeicaza migueldeicaza added a commit that referenced this pull request Feb 9, 2013

@migueldeicaza migueldeicaza Merge pull request #524 from pruiz/mvc-allowhtml-fix
Fixes xamarin-bug #8965: AllowHtmlAttribute ignored throwing exception on POST using ASP.NET mvc3
73277ab

@migueldeicaza migueldeicaza merged commit 73277ab into mono:master Feb 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment