Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsFeedbackFeedbackASPNET Validation Controls vrs PortalSecurity filtersASPNET Validation Controls vrs PortalSecurity filters
Previous
 
Next
New Post
2/21/2008 11:55 PM
 

With reference to the source code of the latest version of the Feedback module, I see the Feedback.ascx file already incorporates ASP.NET validation controls in it, and these obviously take care of more than 1 validation scenario :

<asp:requiredfieldvalidator id="valEmail1" runat="server" cssclass="NormalRed" display="Dynamic" errormessage="<br\>Email Is Required."
controltovalidate="txtEmail" resourcekey="valEmail1" ValidationGroup="FeedbackForm"></asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id="valEmail2" runat="server" cssclass="NormalRed" display="Dynamic" errormessage="<br\>Email Must be Valid."
controltovalidate="txtEmail" resourcekey="valEmail2" ValidationGroup="FeedbackForm" validationexpression="[\w\.-]+(\+[\w-]*)?@([\w-]+\.)+[\w-]+"></asp:regularexpressionvalidator>

Please correct me if I'm wrong, but aren't these validators supposed to take care of server-side validation as well (in scenarios where JS is disabled on the browser or when the EnableClientScript for the control itself is set to false)?.And can't HTML/SQL/Script input validation also not be done with these validator controls? If that's the case, then why is there a need for additional code in feedback.ascx.vb:

See line 311 in feedback.ascx.vb :

Dim strBody As String = objPortalSecurity.InputFilter(txtBody.Text, _
PortalSecurity.FilterFlag.NoScripting And _
PortalSecurity.FilterFlag.NoSQL And PortalSecurity.FilterFlag.NoMarkup)

And the code above will not allow you to two types of validations at the same time, i.e., if you choose nosql, it doesn't do the check for nomarkup, noscripting, whereas the validation controls take care of more than 1 type of input validation. Also, friendly error messages are not being displayed with the above code, whereas the same can be done with validation controls using the errormessage attribute.

I mean, wouldn't stopping invalid/dangerous inputs altogether via the ASP.NET validation controls be better than stripping or replacing invalid input (while at the same time, accepting it) ? Is this something to do with how DNN works?

 
New Post
2/22/2008 1:29 AM
 

Mark - I'll wait for others to chime in on this post - if they actually have the time to respond. I did send you an email regarding this but you obviously felt that you needed another response. With regards to the server side validation that we're doing, there isn't meant to be an error message - this is basically an inbuilt function that is used to strip out unwanted characters. We do the same with URLFormatting - should we now tell the user that the URL is incorrect too?
The goal there (with the PortalSecurity.FilterFlag.NoMarkup or any of the other Input Filters is to provide a consistent way to handle input variables. 
I had already mentioned in an earlier email, the full source for the feedback module (just like everything else from DNN) is freely available to you - if you want to make any changes to suit your particular environment/project, you are not restricted from doing so. Not sure why you're instead trying to get others to make these changes for you?

Sanjay

 


AcuitiDP - Oracle Data Provider for DotNetNuke
 
New Post
2/22/2008 3:04 AM
 

Sanjay, my last 2 emails went unanswered, so I assumed you were too busy, hence I posted for others' benefit, besides mine. I'm not at all trying to get others to do changes on my behalf. On the other hand, I was trying to understand the input filters-why they're required when ASPNET validation controls are already available and you yourself said that the filters cannot filter 2 or more invalid inputs whereas, IMHO, we can insert any number of ASPNET validation controls to handle all types of invalid inputs and all of these would not only be processed to display friendly error messages but would also altogether stop the inputs from being saved in the database.

 
New Post
2/22/2008 3:49 AM
 

the current procedure is intended, it ensures, that the user fills in required data in the correct format, but server side (which cannot be tricked by hackers) it makes sure, that no scripts can be executed by displaying the content or storing it in the database. This is best practice.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/22/2008 4:12 AM
 

Sebastian,  don't the ASPNET validator  controls  perform these very same functions even on the server-side and they can also additionally display friendly error messages?  I'm not saying that the input filters are bad, but I'd prefer stopping all invalid inputs from being saved rather than just stripping away/encoding invalid characters and storing the rest in the DB. And wouldn't using both the ASPNET validators as well as the input filters be overkill?

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsFeedbackFeedbackASPNET Validation Controls vrs PortalSecurity filtersASPNET Validation Controls vrs PortalSecurity filters


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out