pfeifferNet

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
since
5.4.0
since
5.5.0

Inherit standard singleton class.

since
5.8.0

Handle multiple file uploads.

since
5.11.0

Deprecated global singleton.

since
5.12.0

Replaced depecated PHP filter constant.

since
6.1.0

Added get_request_vars() method.

used-by
Add_Ratings
used-by
Add_Ratings::__construct()
used-by
Form_Send_Email
used-by
Form_Send_Email::__construct()
used-by
Related_Posts::__construct()
used-by
Settings_Import
used-by
Settings_Import::__construct()
used-by
Tools
used-by
Tools::__construct()
used-by
Updater::__construct()
used-by
Form
used-by
Form::__construct()

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
since
5.11.0

Methods

get_cookies()

Return the sanitised $_COOKIE variables.

public get_cookies() : array<string|int, string>
Tags
since
5.7.0
since
5.12.0

Replaced depecated PHP filter constant.

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
since
5.4.0
since
5.8.0

Handle multiple uploads.

used-by
Form_Send_Email::handle_ajax_request()
used-by
Settings_Import::handle_ajax_request()
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_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
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
since
5.4.0
since
5.12.0

Replaced depecated PHP filter constant.

used-by
Add_Ratings::handle_ajax_request()
used-by
Chapter_Meta::save()
used-by
User_Favourites::handle_ajax_request()
used-by
Form_Send_Email::handle_ajax_request()
used-by
Related_Posts::handle_ajax_request()
used-by
Tax_Meta::save()
used-by
Form::handle_submission()
used-by
Term_Archive::handle_filter_request()
used-by
Users::update_extra_profile_fields()
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
since
6.1.0
Return values
array<string|int, string>

The sanitised $_REQUEST variables.

__construct()

Initialise the class.

protected __construct() : void
Tags
since
5.11.0

        
On this page

Search results