Input Filtering Class

package XenForo_Core

 Methods

Constructor

__construct(\Zend_Controller_Request_Http | array $source) 

Parameters

$source

\Zend_Controller_Request_Httparray

Source of input

__get()

__get($key) 

Parameters

$key

__isset()

__isset($key) 

Parameters

$key

Cleans invalid characters out of a string, such as nulls, nbsp, \r, etc.

cleanString(string $string) : string

Characters may not strictly be invalid, but can cause confusion/bugs.

Parameters

$string

string

Returns

string

Filter an array of items

filter(array $filters) : array

Parameters

$filters

array

Key-value pairs with the value being in the format expected by filterSingle. {@link XenForo_Input::filterSingle()}

Returns

arraykey-value pairs with the cleaned value

Filter an individual item

filterSingle(string $variableName, mixed $filterData, array $options) : mixed

Parameters

$variableName

string

Name of the input variable

$filterData

mixed

Filter information, can be a single constant or an array containing a filter and options

$options

array

Filtering options

Returns

mixedValue after being cleaned

Gets all input.

getInput() : array

Returns

array

Returns true if the given key was included in the request at all.

inRequest(string $key) : boolean

Parameters

$key

string

Returns

boolean

Statically filters a piece of data as the requested type.

rawFilter(mixed $data, \constant $filterName, array $options) : mixed

Parameters

$data

mixed

$filterName

\constant

$options

array

Returns

mixed

_doClean()

_doClean($filterName, array $filterOptions, $data, $defaultData) 

Parameters

$filterName

$filterOptions

$data

$defaultData

 Properties

 

Default values for the input types

$_DEFAULTS : array

 

Cached cleaned variables.

$_cleanedVariables : array

Key is the variable name as it was pulled

 

The request object that variables will be read from.

$_request : \Zend_Controller_Request_Http | null

May be null if source data is populated instead

 

Alternative to the request, data can come from an array.

$_sourceData : array | null

 

Map of from-to pairs of things to manipulate in strings.

$_strClean : array

 Constants

 

ARRAY_SIMPLE

ARRAY_SIMPLE 

 

BINARY

BINARY 

 

DATE_TIME

DATE_TIME 

 

FLOAT

FLOAT 

 

INT

INT 

 

JSON_ARRAY

JSON_ARRAY 

 

NUM

NUM 

 

STRING

STRING 

 

UINT

UINT 

 

UNUM

UNUM