1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 11:44:08 +02:00

[ticket/14875] Move raw_variable() method to request_interface

PHPBB3-14875
This commit is contained in:
Marc Alexander
2016-12-02 11:36:07 +01:00
parent 08bf8812d3
commit 9bdd002f58
4 changed files with 28 additions and 23 deletions

View File

@@ -64,6 +64,28 @@ interface request_interface
*/
public function variable($var_name, $default, $multibyte = false, $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.
*
* @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 \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* 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.
*/
public function raw_variable($var_name, $default, $super_global = \phpbb\request\request_interface::REQUEST);
/**
* Shortcut method to retrieve SERVER variables.
*