[ Index ]

PHP Cross Reference of phpBB-3.2.8-deutsch

title

Body

[close]

/phpbb/request/ -> request.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 454 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

request:: (19 methods):
  __construct()
  super_globals_disabled()
  disable_super_globals()
  enable_super_globals()
  overwrite()
  variable()
  untrimmed_variable()
  raw_variable()
  server()
  header()
  file()
  is_set_post()
  is_set()
  is_ajax()
  is_secure()
  variable_names()
  _variable()
  get_super_global()
  escape()


Class: request  - X-Ref

All application input is accessed through this class.

It provides a method to disable access to input data through super globals.
This should force MOD authors to read about data validation.
__construct(\phpbb\request\type_cast_helper_interface $type_cast_helper = null, $disable_super_globals = true)   X-Ref
Initialises the request class, that means it stores all input data in {@link $input input}
and then calls {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global}


super_globals_disabled()   X-Ref
Getter for $super_globals_disabled

return: bool    Whether super globals are disabled or not.

disable_super_globals()   X-Ref
Disables access of super globals specified in $super_globals.
This is achieved by overwriting the super globals with instances of {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global}


enable_super_globals()   X-Ref
Enables access of super globals specified in $super_globals if they were disabled by {@link disable_super_globals disable_super_globals}.
This is achieved by making the super globals point to the data stored within this class in {@link $input input}.


overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
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

param: string    $var_name    The name of the variable that shall be overwritten
param: mixed    $value        The value which the variable shall contain.
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global

variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
Central type safe input handling function.
All variables in GET or POST requests should be retrieved through this function to maximise security.

param: string|array    $var_name    The form variable's name from which data shall be retrieved.
param: mixed            $default    A default value that is returned if the variable was not set.
param: bool            $multibyte    If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
return: mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the

untrimmed_variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
Get a variable, but without trimming strings.
Same functionality as variable(), except does not run trim() on strings.
This method should be used when handling passwords.

param: string|array    $var_name    The form variable's name from which data shall be retrieved.
param: mixed            $default    A default value that is returned if the variable was not set.
param: bool            $multibyte    If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
return: mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the

raw_variable($var_name, $default, $super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
{@inheritdoc}


server($var_name, $default = '')   X-Ref
Shortcut method to retrieve SERVER variables.

Also fall back to getenv(), some CGI setups may need it (probably not, but
whatever).

param: string|array    $var_name        See \phpbb\request\request_interface::variable
param: mixed            $Default        See \phpbb\request\request_interface::variable
return: mixed    The server variable value.

header($header_name, $default = '')   X-Ref
Shortcut method to retrieve the value of client HTTP headers.

param: string|array    $header_name    The name of the header to retrieve.
param: mixed            $default        See \phpbb\request\request_interface::variable
return: mixed    The header value.

file($form_name)   X-Ref
Shortcut method to retrieve $_FILES variables

param: string $form_name The name of the file input form element
return: array The uploaded file's information or an empty array if the

is_set_post($name)   X-Ref
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.

param: string    $name    The name of the form variable which should have a
return: bool            True if the variable was set in a POST request, false otherwise.

is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
Checks whether a certain variable is set in one of the super global
arrays.

param: string    $var    Name of the variable
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
return: bool            True if the variable was sent as input

is_ajax()   X-Ref
Checks whether the current request is an AJAX request (XMLHttpRequest)

return: bool            True if the current request is an ajax request

is_secure()   X-Ref
Checks if the current request is happening over HTTPS.

return: bool            True if the request is secure.

variable_names($super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
Returns all variable names for a given super global

param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
return: array    All variable names that are set for the super global.

_variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST, $trim = true)   X-Ref
Helper function used by variable() and untrimmed_variable().

param: string|array    $var_name    The form variable's name from which data shall be retrieved.
param: mixed            $default    A default value that is returned if the variable was not set.
param: bool            $multibyte    If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
param: bool            $trim        Indicates whether trim() should be applied to string values.
return: mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the

get_super_global($super_global = \phpbb\request\request_interface::REQUEST)   X-Ref
{@inheritdoc}


escape($var, $multibyte)   X-Ref
{@inheritdoc}




Generated: Sat Oct 26 11:28:42 2019 Cross-referenced by PHPXref 0.7.1