Bug 8965 - AllowHtmlAttribute ignored throwing exception on POST using ASP.NET mvc3
Summary: AllowHtmlAttribute ignored throwing exception on POST using ASP.NET mvc3
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web ()
Version: master
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-12-16 02:38 UTC by Pablo Ruiz García
Modified: 2016-05-27 22:12 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Pablo Ruiz García 2012-12-16 02:38:00 UTC
Hi,

On a few minutes I'll be sending a pull-request fixing this issue, and I need a xamarin's bug-id... 

This bug was already present on novell's bugzilla reported by someone else (https://bugzilla.novell.com/show_bug.cgi?id=704529). But in the end no one fixed it.

Following is a copy the initial description of the problem, for reference. But for more details you should take a look at novell's stie.

===== ORIGINAL BUG DESCRIPTION =====

Syed Rahman 2011-07-07 22:49:09 UTC
User-Agent:       Mozilla/5.0 (Windows NT 6.0; rv:5.0) Gecko/20100101
Firefox/5.0

Using the AllowHtmlAttribute to mark a property on a model so that you can post
html on a form to your controller throws an exception

System.Web.HttpRequestValidationException

with the "A potentially dangerous Form value ..."
messasge even though the AllowHtmlAttribute property is for the purpose of not
validating to see if html exists in property.


Reproducible: Always

Steps to Reproduce:
1. Create a model with a property marked with [AllowHtml]
2. Create a controller with both Get and Post action with the model being in
post
3. Create a view which submits to controller action, with the property being a
textbox, and a button ot submit
4. Fire up the view, put some html in the textbox and post

Exception thrown

In step 4, put basic text, submits fine
Actual Results:  
Exception thrown

Expected Results:  
Should have submitted form to action
Comment 1 Miguel de Icaza [MSFT] 2013-02-09 17:22:10 UTC
Applied the fix.
Comment 2 Juan Urroa 2016-05-27 22:12:57 UTC
This is happening in mvc 5.2.3, also it seems there is no way to disable validation