InvalidChars
in package
implements
FilterInterface
InvalidChars filter.
Check if user input data ($_GET, $_POST, $_COOKIE, php://input) do not contain invalid characters:
- invalid UTF-8 characters
- control characters except line break and tab code
Tags
Table of Contents
Interfaces
- FilterInterface
- Filter interface
Properties
- $controlCodeRegex : string
- Regular expressions for valid control codes
- $source : string
- Data source
Methods
- after() : void
- We don't have anything to do here.
- before() : void
- Check invalid characters.
- checkControl() : array<string|int, mixed>|string
- Check for the presence of control characters except line breaks and tabs.
- checkEncoding() : array<string|int, mixed>|string
- Check the character encoding is valid UTF-8.
Properties
$controlCodeRegex
Regular expressions for valid control codes
protected
string
$controlCodeRegex
= '/\A[\r\n\t[:^cntrl:]]*\z/u'
$source
Data source
protected
string
$source
Methods
after()
We don't have anything to do here.
public
after(RequestInterface $request, ResponseInterface $response[, array<int, string>|null $arguments = null ]) : void
Parameters
- $request : RequestInterface
- $response : ResponseInterface
- $arguments : array<int, string>|null = null
before()
Check invalid characters.
public
before(RequestInterface $request[, array<int, string>|null $arguments = null ]) : void
Parameters
- $request : RequestInterface
- $arguments : array<int, string>|null = null
checkControl()
Check for the presence of control characters except line breaks and tabs.
protected
checkControl(array<string|int, mixed>|string $value) : array<string|int, mixed>|string
Parameters
- $value : array<string|int, mixed>|string
Return values
array<string|int, mixed>|stringcheckEncoding()
Check the character encoding is valid UTF-8.
protected
checkEncoding(array<string|int, mixed>|string $value) : array<string|int, mixed>|string
Parameters
- $value : array<string|int, mixed>|string