PHP 클래스 HTMLPurifier_Lexer_DOMLex, yii

In PHP 5, the DOM XML extension was revamped into DOM and added to the core. It gives us a forgiving HTML parser, which we use to transform the HTML into a DOM, and then into the tokens. It is blazingly fast (for large documents, it performs twenty times faster than HTMLPurifier_Lexer_DirectLex,and is the default choice for PHP 5.
상속: extends HTMLPurifier_Lexer
파일 보기 프로젝트 열기: yiisoft/yii

공개 메소드들

메소드 설명
__construct ( )
callbackArmorCommentEntities ( array $matches ) : string Callback function that entity-izes ampersands in comments so that callbackUndoCommentSubst doesn't clobber them
callbackUndoCommentSubst ( array $matches ) : string Callback function for undoing escaping of stray angled brackets in comments
muteErrorHandler ( integer $errno, string $errstr ) An error handler that mutes all errors
tokenizeHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : HTMLPurifier_Token[]

보호된 메소드들

메소드 설명
createEndNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens )
createStartNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens, boolean $collect ) : boolean
tokenizeDOM ( DOMNode $node, HTMLPurifier_Token[] &$tokens ) : HTMLPurifier_Token Iterative function that tokenizes a node, putting it into an accumulator.
transformAttrToAssoc ( DOMNamedNodeMap $node_map ) : array Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array.
wrapHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : string Wraps an HTML fragment in the necessary HTML

메소드 상세

__construct() 공개 메소드

public __construct ( )

callbackArmorCommentEntities() 공개 메소드

Callback function that entity-izes ampersands in comments so that callbackUndoCommentSubst doesn't clobber them
public callbackArmorCommentEntities ( array $matches ) : string
$matches array
리턴 string

callbackUndoCommentSubst() 공개 메소드

Callback function for undoing escaping of stray angled brackets in comments
public callbackUndoCommentSubst ( array $matches ) : string
$matches array
리턴 string

createEndNode() 보호된 메소드

protected createEndNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens )
$node DOMNode
$tokens HTMLPurifier_Token[]

createStartNode() 보호된 메소드

protected createStartNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens, boolean $collect ) : boolean
$node DOMNode DOMNode to be tokenized.
$tokens HTMLPurifier_Token[] Array-list of already tokenized tokens.
$collect boolean Says whether or start and close are collected, set to false at first recursion because it's the implicit DIV tag you're dealing with.
리턴 boolean if the token needs an endtoken

muteErrorHandler() 공개 메소드

An error handler that mutes all errors
public muteErrorHandler ( integer $errno, string $errstr )
$errno integer
$errstr string

tokenizeDOM() 보호된 메소드

To iterate is human, to recurse divine - L. Peter Deutsch
protected tokenizeDOM ( DOMNode $node, HTMLPurifier_Token[] &$tokens ) : HTMLPurifier_Token
$node DOMNode DOMNode to be tokenized.
$tokens HTMLPurifier_Token[] Array-list of already tokenized tokens.
리턴 HTMLPurifier_Token of node appended to previously passed tokens.

tokenizeHTML() 공개 메소드

public tokenizeHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : HTMLPurifier_Token[]
$html string
$config HTMLPurifier_Config
$context HTMLPurifier_Context
리턴 HTMLPurifier_Token[]

transformAttrToAssoc() 보호된 메소드

Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array.
protected transformAttrToAssoc ( DOMNamedNodeMap $node_map ) : array
$node_map DOMNamedNodeMap DOMNamedNodeMap of DOMAttr objects.
리턴 array Associative array of attributes.

wrapHTML() 보호된 메소드

Wraps an HTML fragment in the necessary HTML
protected wrapHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : string
$html string
$config HTMLPurifier_Config
$context HTMLPurifier_Context
리턴 string