\CWhitelist

Act as whitelist (or blacklist).

Summary

Methods
Properties
Constants
set()
check()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$whitelist
N/A

Properties

$whitelist

$whitelist : 

Array to contain the whitelist options.

Type

Methods

set()

set(array  $whitelist = array()) : $this

Set the whitelist from an array of strings, each item in the whitelist should be a regexp without the surrounding / or #.

Parameters

array $whitelist

with all valid options, default is to clear the whitelist.

Returns

$this

check()

check(string  $item, array  $whitelist = null) : boolean

Check if item exists in the whitelist.

Parameters

string $item

string to check.

array $whitelist

optional with all valid options, default is null.

Returns

boolean —

true if item is in whitelist, else false.