phpBB

Code Changes

File: phpbb/request/request.php

  Unmodified   Added   Modified   Removed
Line 39Line 39
	protected $original_request = null;

/**

	protected $original_request = null;

/**

	* @var

	* @var bool

	*/
protected $super_globals_disabled = false;


	*/
protected $super_globals_disabled = false;


Line 137Line 137
	* 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
*

	* 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.
* If this is null the variable will be unset.
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global shall be changed

	* @param	string	$var_name		The name of the variable that shall be overwritten
* @param mixed $value The value which the variable shall contain.
* If this is null the variable will be unset.
* @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global shall be changed

	*/
public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
{

	*/
public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
{

Line 173Line 173
	* Central type safe input handling function.
* All variables in GET or POST requests should be retrieved through this function to maximise security.
*

	* 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.
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used

	* @param	string|array	$var_name		The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used

	*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.

	*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.

Line 197Line 197
	* Same functionality as variable(), except does not run trim() on strings.
* This method should be used when handling passwords.
*

	* 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.
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used

	* @param	string|array	$var_name		The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used

	*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.

	*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.

Line 334Line 334
	* Checks whether a certain variable is set in one of the super global
* arrays.
*

	* 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
* Specifies the super global which shall be checked

	* @param	string	$var			Name of the variable
* @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies the super global which shall be checked

	*

	*

	* @return	bool			True if the variable was sent as input

	* @return	bool					True if the variable was sent as input

	*/
public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
{

	*/
public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
{

Line 370Line 370
	/**
* Returns all variable names for a given super global
*

	/**
* Returns all variable names for a given super global
*

	* @param	\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE	$super_global
* The super global from which names shall be taken

	* @param	string	$super_global	(\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* The super global from which names shall be taken

	*
* @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised!

	*
* @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised!

Line 389Line 389
	/**
* Helper function used by variable() and untrimmed_variable().
*

	/**
* Helper function used by variable() and untrimmed_variable().
*

	* @param	string|array	$var_name	The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
* @param bool $trim Indicates whether trim() should be applied to string values.

	* @param	string|array	$var_name		The form variable's name from which data shall be retrieved.
* If the value is an array this may be an array of indizes which will give
* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
* then specifying array("var", 1) as the name will return "a".
* @param mixed $default A default value that is returned if the variable was not set.
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this parameter has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
* @param string $super_global (\phpbb\request\request_interface::POST|GET|REQUEST|COOKIE)
* Specifies which super global should be used
* @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
* the same as that of $default. If the variable is not set $default is returned.

	*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.