C# 클래스 Tp.Web.Extensions.Components.Sanitizer

Clean up HTML code, remove dangerous fragments, such as styles, scripts, event attributes, forms, etc...
IDEA: Use HtmlTextWriter from the .NET framework to write resulting HTML code.
파일 보기 프로젝트 열기: TargetProcess/Tp.HelpDesk 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_enabled bool
_tags List

공개 메소드들

메소드 설명
Sanitize ( string input ) : string

Sanitize input HTML using default settings.

Sanitize ( TextReader input, TextWriter result ) : void
Sanitizer ( ) : System
TextToHtml ( string text ) : string

보호된 메소드들

메소드 설명
After ( TextWriter result ) : void
Before ( TextWriter result ) : void
CaseCData ( HtmlReader htmlReader, TextWriter result ) : void
CaseElement ( HtmlReader htmlReader, TextWriter result ) : void
CaseEndElement ( HtmlReader htmlReader, TextWriter result ) : void
CaseText ( HtmlReader htmlReader, TextWriter result ) : void
CheckStack ( ) : void
FuzzyPopTag ( string item ) : bool

Finds the specified tag somewhere in the stack and removes it from there.

IsValidAttribute ( string key, string value ) : bool
PopTag ( ) : string
Reset ( ) : void

Reset internal state left from previous run.

Sanitize ( HtmlReader htmlReader, TextWriter result ) : void
TopTag ( ) : string
WriteCData ( TextWriter result, string value ) : void
WriteElement ( TextWriter result, string name, StringDictionary attributes, bool empty ) : void
WriteEndElement ( TextWriter result, string name ) : void
WriteString ( TextWriter result, string value ) : void

비공개 메소드들

메소드 설명
PushTag ( string item ) : void

메소드 상세

After() 보호된 메소드

protected After ( TextWriter result ) : void
result System.IO.TextWriter
리턴 void

Before() 보호된 메소드

protected Before ( TextWriter result ) : void
result System.IO.TextWriter
리턴 void

CaseCData() 보호된 메소드

protected CaseCData ( HtmlReader htmlReader, TextWriter result ) : void
htmlReader HtmlReader
result System.IO.TextWriter
리턴 void

CaseElement() 보호된 메소드

protected CaseElement ( HtmlReader htmlReader, TextWriter result ) : void
htmlReader HtmlReader
result System.IO.TextWriter
리턴 void

CaseEndElement() 보호된 메소드

protected CaseEndElement ( HtmlReader htmlReader, TextWriter result ) : void
htmlReader HtmlReader
result System.IO.TextWriter
리턴 void

CaseText() 보호된 메소드

protected CaseText ( HtmlReader htmlReader, TextWriter result ) : void
htmlReader HtmlReader
result System.IO.TextWriter
리턴 void

CheckStack() 보호된 메소드

protected CheckStack ( ) : void
리턴 void

FuzzyPopTag() 보호된 메소드

Finds the specified tag somewhere in the stack and removes it from there.
protected FuzzyPopTag ( string item ) : bool
item string Item to remove.
리턴 bool

IsValidAttribute() 보호된 메소드

protected IsValidAttribute ( string key, string value ) : bool
key string
value string
리턴 bool

PopTag() 보호된 메소드

protected PopTag ( ) : string
리턴 string

Reset() 보호된 메소드

Reset internal state left from previous run.
protected Reset ( ) : void
리턴 void

Sanitize() 공개 정적인 메소드

Sanitize input HTML using default settings.
public static Sanitize ( string input ) : string
input string Input HTML. May be null.
리턴 string

Sanitize() 보호된 메소드

protected Sanitize ( HtmlReader htmlReader, TextWriter result ) : void
htmlReader HtmlReader
result System.IO.TextWriter
리턴 void

Sanitize() 공개 메소드

public Sanitize ( TextReader input, TextWriter result ) : void
input TextReader
result System.IO.TextWriter
리턴 void

Sanitizer() 공개 메소드

public Sanitizer ( ) : System
리턴 System

TextToHtml() 공개 정적인 메소드

public static TextToHtml ( string text ) : string
text string
리턴 string

TopTag() 보호된 메소드

protected TopTag ( ) : string
리턴 string

WriteCData() 보호된 메소드

protected WriteCData ( TextWriter result, string value ) : void
result System.IO.TextWriter
value string
리턴 void

WriteElement() 보호된 메소드

protected WriteElement ( TextWriter result, string name, StringDictionary attributes, bool empty ) : void
result System.IO.TextWriter
name string
attributes System.Collections.Specialized.StringDictionary
empty bool
리턴 void

WriteEndElement() 보호된 메소드

protected WriteEndElement ( TextWriter result, string name ) : void
result System.IO.TextWriter
name string
리턴 void

WriteString() 보호된 메소드

protected WriteString ( TextWriter result, string value ) : void
result System.IO.TextWriter
value string
리턴 void

프로퍼티 상세

_enabled 보호되어 있는 프로퍼티

Whether to write elements.
protected bool _enabled
리턴 bool

_tags 보호되어 있는 프로퍼티

Stack with tags.
protected List _tags
리턴 List