request_interface
interface request_interface
An interface through which all application input can be accessed.
Constants
POST |
|
GET |
|
REQUEST |
|
COOKIE |
|
SERVER |
|
FILES |
|
Methods
This function allows overwriting or setting a value in one of the super global arrays.
Central type safe input handling function.
Get a variable without trimming strings and without escaping.
Shortcut method to retrieve SERVER variables.
Shortcut method to retrieve the value of client HTTP headers.
Checks whether a certain variable was sent via POST.
Checks whether a certain variable is set in one of the super global arrays.
Checks whether the current request is an AJAX request (XMLHttpRequest)
Checks if the current request is happening over HTTPS.
Returns all variable names for a given super global
Returns the original array of the requested super global
Escape a string variable.
Details
at line 45
overwrite(string $var_name, mixed $value, string $super_global = \phpbb\request\request_interface::REQUEST)
This function allows overwriting or setting a value in one of the super global arrays.
Changes which are performed on the super globals directly will not have any effect on the results of other methods this class provides. Using this function should be avoided if possible! It will consume twice the the amount of memory of the value
at line 65
mixed
variable(string|array $var_name, mixed $default, bool $multibyte = false, string $super_global = \phpbb\request\request_interface::REQUEST)
Central type safe input handling function.
All variables in GET or POST requests should be retrieved through this function to maximise security.
at line 87
mixed
raw_variable(string|array $var_name, mixed $default, string $super_global = \phpbb\request\request_interface::REQUEST)
Get a variable without trimming strings and without escaping.
This method MUST NOT be used with queries. Same functionality as variable(), except does not run trim() on strings and does not escape input. This method should only be used when the raw input is needed without any escaping, i.e. for database password during the installation.
at line 97
mixed
server(string|array $var_name, mixed $default = '')
Shortcut method to retrieve SERVER variables.
at line 107
mixed
header(string|array $header_name, mixed $default = '')
Shortcut method to retrieve the value of client HTTP headers.
at line 119
bool
is_set_post(string $name)
Checks whether a certain variable was sent via POST.
To make sure that a request was sent using POST you should call this function on at least one variable.
at line 131
bool
is_set(string $var, string $super_global = \phpbb\request\request_interface::REQUEST)
Checks whether a certain variable is set in one of the super global arrays.
at line 138
bool
is_ajax()
Checks whether the current request is an AJAX request (XMLHttpRequest)
at line 145
bool
is_secure()
Checks if the current request is happening over HTTPS.
at line 156
array
variable_names(string $super_global = \phpbb\request\request_interface::REQUEST)
Returns all variable names for a given super global
at line 166
array
get_super_global(string $super_global = \phpbb\request\request_interface::REQUEST)
Returns the original array of the requested super global
at line 176
string|array
escape(mixed $value, bool $multibyte)
Escape a string variable.