HtmlCleaner
class HtmlCleaner (View source)
Html Cleaner object.
Forked from the php input filter library by: Daniel Morris dan@rootcube.com Original Contributors: Gianpaolo Racca, Ghislain Picard, Marco Wandschneider, Chris Tobin and Andrew Eddie.
Constants
USE_WHITE_LIST |
|
USE_BLACK_LIST |
|
ONLY_ESSENTIAL |
|
Properties
array | $tagsArray | The array of permitted tags (white list). | |
array | $attrArray | The array of permitted tag attributes (white list). | |
integer | $tagsMethod | The method for sanitising tags: WhiteList method = 0 (default), BlackList method = 1 | |
integer | $attrMethod | The method for sanitising attributes: WhiteList method = 0 (default), BlackList method = 1 | |
integer | $xssAuto | A flag for XSS checks. Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1 | |
array | $tagBlacklist | The list of the default blacklisted tags. | |
array | $attrBlacklist | The list of the default blacklisted tag attributes. All event handlers implicit. |
Methods
Constructor for inputFilter class. Only first parameter is required.
Function to determine if contents of an attribute are safe
Internal method to iteratively remove all unwanted tags and attributes
Try to convert to plaintext
getTagsMethod
setTagsMethod
getAttrMethod
setAttrMethod
getXssAuto
setXssAuto
Details
at line line 123
__construct(array $tagsArray = array(), array $attrArray = array(), integer $tagsMethod = self::USE_BLACK_LIST, integer $attrMethod = self::USE_BLACK_LIST, integer $xssAuto = 1)
Constructor for inputFilter class. Only first parameter is required.
at line line 146
static boolean
isBadAttribute(array $attrSubSet)
Function to determine if contents of an attribute are safe
at line line 170
string
remove(string $source)
Internal method to iteratively remove all unwanted tags and attributes
at line line 529
string
decode(string $source)
Try to convert to plaintext
at line line 629
int
getTagsMethod()
getTagsMethod
at line line 641
HtmlCleaner
setTagsMethod(int $tagsMethod)
setTagsMethod
at line line 653
int
getAttrMethod()
getAttrMethod
at line line 665
HtmlCleaner
setAttrMethod(int $attrMethod)
setAttrMethod
at line line 677
int
getXssMethod()
getXssAuto
at line line 689
HtmlCleaner
setXssMethod(int $xssAuto)
setXssAuto