Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Question about sanitizing w/ AntiXss

$
0
0

Where is the best place to sanitize? I was thinking about doing the following but someone may have a better idea

public class myObject
{
   [Required]
   public string SomeTextField {get; set;}
   public string SomeTextFieldSanitized
   {
      get { return Sanitizer.GetSafeHtmlFragment(SomeTextField); }
   }

   [Required]
   public string SomeOtherTextField {get; set;}
   public string SomeOtherTextFieldSanitized
   {
      get { return Sanitizer.GetSafeHtmlFragment(SomeOtherTextField); }
   }
}

This way, I can just work with properties that have the "Sanitized" in their names.

Is there a better way to handle this?


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>