How can custom some char to safelist?

Nov 12, 2010 at 7:34 AM

I see this library can customizable safe list ,so I download sourcecode,but I can't find this solution.

pls give me help,some like SampleCode or Document or ConfigractionFiles.


Nov 12, 2010 at 9:27 AM
Edited Nov 12, 2010 at 9:28 AM

I got it.

I want add char "|" to whitelist.

first I get this char ASCII Code .

second change 2 files.

(1) Open “Microsoft.Security.Application.Encoder\Encoder.cs”
Find Method "private static char[][] InitializeSafeList()
Append "i == 124 ||                     // |"
to After  "i == 95 ||                      // _"
(2) Open “Microsoft.Security.Application.Encoder\HtmlParameterEncoder.cs”
Find Method "private static IEnumerable UrlParameterSafeList()"
Append "yield return 0x7C;"
to After  "yield return 0x7E;"

Change done.
Rebuild solution.