[ Index ]

PHP Cross Reference of phpBB-3.3.0-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.

return: mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
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 parameter has to be true if the variable may contain any UTF-8 characters
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global

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.

return: mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
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 parameter has to be true if the variable may contain any UTF-8 characters
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global

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).

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

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

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

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

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

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.

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

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.

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

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

return: array    All variable names that are set for the super global.
param: \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $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().

return: mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
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 parameter 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.

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


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




Generated: Tue Apr 7 19:44:41 2020 Cross-referenced by PHPXref 0.7.1