diff options
| -rw-r--r-- | phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php | 6 | ||||
| -rw-r--r-- | phpBB/phpbb/install/helper/iohandler/iohandler_interface.php | 4 | ||||
| -rw-r--r-- | phpBB/phpbb/request/request.php | 19 | ||||
| -rw-r--r-- | phpBB/phpbb/request/request_interface.php | 22 | 
4 files changed, 28 insertions, 23 deletions
diff --git a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php index 2db6750f3f..a40d457466 100644 --- a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php +++ b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php @@ -27,7 +27,7 @@ class ajax_iohandler extends iohandler_base  	protected $path_helper;  	/** -	 * @var \phpbb\request\request +	 * @var \phpbb\request\request_interface  	 */  	protected $request; @@ -90,12 +90,12 @@ class ajax_iohandler extends iohandler_base  	 * Constructor  	 *  	 * @param path_helper						$path_helper -	 * @param \phpbb\request\request	$request	HTTP request interface +	 * @param \phpbb\request\request_interface	$request	HTTP request interface  	 * @param \phpbb\template\template			$template	Template engine  	 * @param router 							$router		Router  	 * @param string 							$root_path	Path to phpBB's root  	 */ -	public function __construct(path_helper $path_helper, \phpbb\request\request $request, \phpbb\template\template $template, router $router, $root_path) +	public function __construct(path_helper $path_helper, \phpbb\request\request_interface $request, \phpbb\template\template $template, router $router, $root_path)  	{  		$this->path_helper = $path_helper;  		$this->request	= $request; diff --git a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php index f0e0e99bbb..440748901c 100644 --- a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php +++ b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php @@ -52,7 +52,7 @@ interface iohandler_interface  	/**  	 * Returns server variable  	 * -	 * This function should work the same as request_interterface::server(). +	 * This function should work the same as request_interface::server().  	 *  	 * @param string	$name		Name of the server variable  	 * @param mixed		$default	Default value to return when the requested variable does not exist @@ -62,7 +62,7 @@ interface iohandler_interface  	public function get_server_variable($name, $default = '');  	/** -	 * Wrapper function for request_interterface::header() +	 * Wrapper function for request_interface::header()  	 *  	 * @param string	$name		Name of the request header variable  	 * @param mixed		$default	Default value to return when the requested variable does not exist diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php index 0d9ffa1780..92d4213180 100644 --- a/phpBB/phpbb/request/request.php +++ b/phpBB/phpbb/request/request.php @@ -225,24 +225,7 @@ class request implements \phpbb\request\request_interface  	}  	/** -	 * 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. +	 * {@inheritdoc}  	 */  	public function raw_variable($var_name, $default, $super_global = \phpbb\request\request_interface::REQUEST)  	{ diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php index 47b3b3a4ed..3bfa8bb424 100644 --- a/phpBB/phpbb/request/request_interface.php +++ b/phpBB/phpbb/request/request_interface.php @@ -65,6 +65,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.  	*  	* @param	string|array	$var_name		See \phpbb\request\request_interface::variable  | 
