PHP Class Redaxscript\Filter\Html

Since: 2.2.0
Author: Henry Ruhs
Inheritance: implements Redaxscript\Filter\Filter
Show file Open project: redaxmedia/redaxscript Class Usage Examples

Protected Properties

Property Type Description
$_allowedAttributes array array of allowed attributes
$_allowedTags array array of allowed tags
$_forbiddenValues array array of forbidden values

Public Methods

Method Description
sanitize ( string $html = null, boolean $filter = true ) : string sanitize the html

Protected Methods

Method Description
_cleanDocument ( DOMDocument $doc ) : DOMDocument clean the document
_createDocument ( string $html = null ) : DOMDocument create the document
_stripAttributes ( object $node = null ) : object strip the attributes
_stripTags ( object $node = null ) : object strip the tags
_stripValues ( object $node = null ) : object strip the values

Method Details

_cleanDocument() protected method

clean the document
Since: 2.6.0
protected _cleanDocument ( DOMDocument $doc ) : DOMDocument
$doc DOMDocument target document
return DOMDocument

_createDocument() protected method

create the document
Since: 2.4.0
protected _createDocument ( string $html = null ) : DOMDocument
$html string target html
return DOMDocument

_stripAttributes() protected method

strip the attributes
Since: 2.4.0
protected _stripAttributes ( object $node = null ) : object
$node object target node
return object

_stripTags() protected method

strip the tags
Since: 2.4.0
protected _stripTags ( object $node = null ) : object
$node object target node
return object

_stripValues() protected method

strip the values
Since: 2.6.0
protected _stripValues ( object $node = null ) : object
$node object target node
return object

sanitize() public method

sanitize the html
Since: 2.4.0
public sanitize ( string $html = null, boolean $filter = true ) : string
$html string target html
$filter boolean optional filter nodes
return string

Property Details

$_allowedAttributes protected property

array of allowed attributes
protected array $_allowedAttributes
return array

$_allowedTags protected property

array of allowed tags
protected array $_allowedTags
return array

$_forbiddenValues protected property

array of forbidden values
protected array $_forbiddenValues
return array