HTTP_Handler
in package
HTTP request sanitisation.
Provide access to sanitised $_COOKIES, $_GET, $_POST, $_FILES and $_SERVER variables. A limited set of sanitised $_REQUEST variables is also provided.
Tags
Table of Contents
Properties
- $instances : array<string|int, object>
- The array of instances of this class and sub-classes.
Methods
- get_cookies() : array<string|int, string>
- Return the sanitised $_COOKIE variables.
- get_files_vars() : array<string|int, mixed>
- Return sanitised $_FILES variables.
- get_get_vars() : array<string|int, string>
- Return the sanitised $_GET variables.
- get_instance() : object
- Creates and/or returns the instance of this class.
- get_post_vars() : array<string|int, string>
- Return the sanitised $_POST variables.
- get_request_vars() : array<string|int, string>
- Return sanitised $_REQUEST variables.
- get_server_vars() : array<string|int, string>
- Return sanitised $_SERVER variables.
- __construct() : void
- Initialise the class.
Properties
$instances
The array of instances of this class and sub-classes.
protected
static array<string|int, object>
$instances
= array()
Tags
Methods
get_cookies()
Return the sanitised $_COOKIE variables.
public
get_cookies() : array<string|int, string>
Tags
Return values
array<string|int, string> —The sanitised $_COOKIE variables.
get_files_vars()
Return sanitised $_FILES variables.
public
get_files_vars() : array<string|int, mixed>
Rearranges $_FILES into a more useful array structure.
Tags
Return values
array<string|int, mixed> —$files_vars { The sanitised and rearranged $_FILES variables. @type array $index { The array of form file input fields. @type string $name The original name of the file on the client machine. @type string $type The mime type of the file, if supplied by browser. @type string $tmp_name The temporary filename of the file stored on the server. @type int $error The upload error code. @type int $size The file size in bytes. } }
get_get_vars()
Return the sanitised $_GET variables.
public
get_get_vars() : array<string|int, string>
Tags
Return values
array<string|int, string> —The sanitised $_GET variables.
get_instance()
Creates and/or returns the instance of this class.
public
static get_instance() : object
Tags
Return values
object —The instance of this class.
get_post_vars()
Return the sanitised $_POST variables.
public
get_post_vars() : array<string|int, string>
Tags
Return values
array<string|int, string> —The sanitised $_POST variables.
get_request_vars()
Return sanitised $_REQUEST variables.
public
get_request_vars() : array<string|int, string>
$_REQUEST is a combination of $_GET, $_POST and $_COOKIE. This method sanitises the $_REQUEST variables and returns them. It assumes a flat structure. It is ALWAYS better to use the specific $_GET, $_POST or $_COOKIE methods.
Tags
Return values
array<string|int, string> —The sanitised $_REQUEST variables.
get_server_vars()
Return sanitised $_SERVER variables.
public
get_server_vars() : array<string|int, string>
Tags
Return values
array<string|int, string> —The sanitised $_SERVER variables.
__construct()
Initialise the class.
protected
__construct() : void