Function to determine if contents of an attribute are safe
static boolean
checkAttribute
(array $attrSubSet)
-
array
$attrSubSet: A 2 element array for attribute's name, value
Returns an input filter object, only creating it if it doesn't already exist.
static
JFilterInput
&getInstance
([
array $tagsArray =
array()], [
array $attrArray =
array()], [
integer $tagsMethod =
0], [
integer $attrMethod =
0], [
integer $xssAuto =
1])
-
array
$tagsArray: List of user-defined tags
-
array
$attrArray: List of user-defined attributes
-
integer
$tagsMethod: WhiteList method = 0, BlackList method = 1
-
integer
$attrMethod: WhiteList method = 0, BlackList method = 1
-
integer
$xssAuto: Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
Constructor for inputFilter class. Only first parameter is required.
JFilterInput
__construct
([array $tagsArray = array()], [array $attrArray = array()], [integer $tagsMethod = 0], [integer $attrMethod = 0], [integer $xssAuto = 1])
-
array
$tagsArray: List of user-defined tags
-
array
$attrArray: List of user-defined attributes
-
integer
$tagsMethod: WhiteList method = 0, BlackList method = 1
-
integer
$attrMethod: WhiteList method = 0, BlackList method = 1
-
integer
$xssAuto: Only auto clean essentials = 0, Allow clean blacklisted tags/attr = 1
Method to be called by another php script. Processes for XSS and specified bad code.
mixed
clean
(mixed $source, [string $type = 'string'])
-
mixed
$source: Input string/array-of-string to be 'cleaned'
-
string
$type: The return type for the variable: INT: An integer, UINT: An unsigned integer, FLOAT: A floating point number, BOOLEAN: A boolean value, WORD: A string containing A-Z or underscores only (not case sensitive), ALNUM: A string containing A-Z or 0-9 only (not case sensitive), CMD: A string containing A-Z, 0-9, underscores, periods or hyphens (not case sensitive), BASE64: A string containing A-Z, 0-9, forward slashes, plus or equals (not case sensitive), STRING: A fully decoded and sanitised string (default), HTML: A sanitised string, ARRAY: An array, PATH: A sanitised file path, USERNAME: Do not use (use an application specific filter), RAW: The raw string is returned with no filtering, unknown: An unknown filter will act like STRING. If the input is an array it will return an array of fully decoded and sanitised strings.
Internal method to strip a tag of certain attributes
array
_cleanAttributes
(array $attrSet)
-
array
$attrSet: Array of attribute pairs to filter
Internal method to strip a string of certain tags
string
_cleanTags
(string $source)
-
string
$source: Input string to be 'cleaned'
Try to convert to plaintext
string
_decode
(string $source)
-
string
$source: The source string.
Escape < > and " inside attribute values
string
_escapeAttributeValues
(string $source)
-
string
$source: The source string.
Internal method to iteratively remove all unwanted tags and attributes
string
_remove
(string $source)
-
string
$source: Input string to be 'cleaned'
Remove CSS Expressions in the form of <property>:expression(...)
string
_stripCSSExpressions
(string $source)
-
string
$source: The source string.