\XssHtml

PHP 富文本XSS过滤类

Summary

Methods
Properties
Constants
__construct()
getHtml()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__true_url()
__get_style()
__get_link()
__setAttr()
__set_default_attr()
__common_attr()
__node_img()
__node_a()
__node_embed()
__node_default()
$m_dom
$m_xss
$m_ok
$m_AllowAttr
$m_AllowTag
N/A

Properties

$m_dom

$m_dom : 

Type

$m_xss

$m_xss : 

Type

$m_ok

$m_ok : 

Type

$m_AllowAttr

$m_AllowAttr : 

Type

$m_AllowTag

$m_AllowTag : 

Type

Methods

__construct()

__construct(string  $html, string  $charset = 'utf-8', array  $AllowTag = array()) 

构造函数

Parameters

string $html

待过滤的文本

string $charset

文本编码,默认utf-8

array $AllowTag

允许的标签,如果不清楚请保持默认,默认已涵盖大部分功能,不要增加危险标签

getHtml()

getHtml() 

获得过滤后的内容

__true_url()

__true_url(  $url) 

Parameters

$url

__get_style()

__get_style(  $node) 

Parameters

$node

__get_link()

__get_link(  $node,   $att) 

Parameters

$node
$att

__setAttr()

__setAttr(  $dom,   $attr,   $val) 

Parameters

$dom
$attr
$val

__set_default_attr()

__set_default_attr(  $node,   $attr,   $default = '') 

Parameters

$node
$attr
$default

__common_attr()

__common_attr(  $node) 

Parameters

$node

__node_img()

__node_img(  $node) 

Parameters

$node

__node_a()

__node_a(  $node) 

Parameters

$node

__node_embed()

__node_embed(  $node) 

Parameters

$node

__node_default()

__node_default(  $node) 

Parameters

$node