class JFilterInput extends JObject


Located at : UKNOWVA_ROOT/libraries/joomla/filter/filterinput.php

JFilterInput is a class for filtering input from any data source

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.

Properties

array $tagsArray An array of permitted tags.
array $attrArray An array of permitted tag attributes.
integer $tagsMethod Method for tags
integer $attrMethod Method for attributes
integer $xssAuto Autoclean
array $tagBlacklist Blacklisted tags
array $attrBlacklist Black listed attributes

Methods

__construct(array $tagsArray = array(), array $attrArray = array(), integer $tagsMethod, integer $attrMethod, integer $xssAuto = 1)

Constructor for inputFilter class. Only first parameter is required.

string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
static object
getInstance(array $tagsArray = array(), array $attrArray = array(), integer $tagsMethod, integer $attrMethod, integer $xssAuto = 1)

Returns an input filter object, only creating it if it doesn't already exist.

mixed
clean(mixed $source, string $type = 'string')

Method to be called by another php script. Processes for XSS and specified bad code.

static boolean
checkAttribute(array $attrSubSet)

Function to determine if contents of an attribute are safe

Details

at line 84
JObject __construct(array $tagsArray = array(), array $attrArray = array(), integer $tagsMethod, integer $attrMethod, integer $xssAuto = 1)

Constructor for inputFilter class. Only first parameter is required.

Parameters

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

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

at line 111
static object getInstance(array $tagsArray = array(), array $attrArray = array(), integer $tagsMethod, integer $attrMethod, integer $xssAuto = 1)

Returns an input filter object, only creating it if it doesn't already exist.

Parameters

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

Return Value

object The JFilterInput object.

at line 139
mixed clean(mixed $source, string $type = 'string')

Method to be called by another php script. Processes for XSS and specified bad code.

Parameters

mixed $source Input string/array-of-string to be 'cleaned'
string $type Return type for the variable (INT, UINT, FLOAT, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, ARRAY, PATH, NONE)

Return Value

mixed 'Cleaned' version of input parameter

at line 251
static boolean checkAttribute(array $attrSubSet)

Function to determine if contents of an attribute are safe

Parameters

array $attrSubSet A 2 element array for attribute's name, value

Return Value

boolean True if bad code is detected