7

I am using the Microsoft anti xss library and I noticed that for some reason it is removing the <ul> tag. I can't figure out why. For instance:

 string html = @"<ul><li>this is a test </li></ul>";
 string sanitized = Sanitizer.GetSafeHtmlFragment(html);

This is returning:

   \r\n<li>this is a test </li>

Any ideas?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
chobo2
  • 83,322
  • 195
  • 530
  • 832
  • 2
    Possibly related to a bug in Sanitizer: [link](http://wpl.codeplex.com/workitem/17246) – Tung Mar 26 '12 at 19:21
  • Hmm. I guess try a older version till this is fixed and see what happens? Anyone know where to get an older version. Nuget seems to only have the newest version. – chobo2 Mar 26 '12 at 19:24
  • 1
    You can download the [source](http://wpl.codeplex.com/SourceControl/changeset/changes/72192) from one of the earlier check-ins and compile it. It contains v3.0, v3.1, and v4.0 – Tung Mar 26 '12 at 19:34
  • 1
    Ya seems like going back to 4.0.1 does the trick. So must be a problem with latest versio. – chobo2 Mar 26 '12 at 21:03
  • @Tung, please post as an answer. – Ray Cheng Jun 01 '12 at 02:44

1 Answers1

1

This is a bug. Users who would like to use one of the older versions can acquire them here

@Ray Cheng, cheers

Tung
  • 5,334
  • 1
  • 34
  • 41