diff options
| author | Tristan Darricau <github@nicofuma.fr> | 2016-12-03 12:32:57 +0100 | 
|---|---|---|
| committer | Tristan Darricau <github@nicofuma.fr> | 2016-12-03 12:32:57 +0100 | 
| commit | 74f49387e17d53903c65c1a82ef75bd871a62af4 (patch) | |
| tree | f6faa28efa1143206f387c139390bd50cdd2edfa /phpBB/phpbb/install/helper/iohandler | |
| parent | 0c96873e731acee531748bad142cf852fdd1d30f (diff) | |
| parent | d817f3cc674433bfe3217b58fce887c48677b382 (diff) | |
| download | forums-74f49387e17d53903c65c1a82ef75bd871a62af4.tar forums-74f49387e17d53903c65c1a82ef75bd871a62af4.tar.gz forums-74f49387e17d53903c65c1a82ef75bd871a62af4.tar.bz2 forums-74f49387e17d53903c65c1a82ef75bd871a62af4.tar.xz forums-74f49387e17d53903c65c1a82ef75bd871a62af4.zip  | |
Merge pull request #4539 from marc1706/ticket/14875
[ticket/14875] Add method for untrimmed input to ajax iohandler
* marc1706/ticket/14875:
  [ticket/14875] Add raw_variable() to request mock
  [ticket/14875] Move raw_variable() method to request_interface
  [ticket/14875] Use raw_variable() method in _variable() to get raw data
  [ticket/14875] Add method for raw input to request and add to installer
  [ticket/14875] Add method for untrimmed input to ajax iohandler
Diffstat (limited to 'phpBB/phpbb/install/helper/iohandler')
3 files changed, 35 insertions, 2 deletions
diff --git a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php index c168d26425..a40d457466 100644 --- a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php +++ b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php @@ -123,6 +123,14 @@ class ajax_iohandler extends iohandler_base  	/**  	 * {@inheritdoc}  	 */ +	public function get_raw_input($name, $default) +	{ +		return $this->request->raw_variable($name, $default); +	} + +	/** +	 * {@inheritdoc} +	 */  	public function get_server_variable($name, $default = '')  	{  		return $this->request->server($name, $default); diff --git a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php index 196cdcdaab..4117a3dfd3 100644 --- a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php +++ b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php @@ -74,6 +74,20 @@ class cli_iohandler extends iohandler_base  		return $result;  	} +	/** +	 * {@inheritdoc} +	 */ +	public function get_raw_input($name, $default) +	{ +		return $this->get_input($name, $default, true); +	} + +	/** +	 * Set input variable +	 * +	 * @param string $name Name of input variable +	 * @param mixed $value Value of input variable +	 */  	public function set_input($name, $value)  	{  		$this->input_values[$name] = $value; diff --git a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php index f22f33d9cb..440748901c 100644 --- a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php +++ b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php @@ -39,9 +39,20 @@ interface iohandler_interface  	public function get_input($name, $default, $multibyte = false);  	/** +	 * Returns raw input variable +	 * +	 * @param string	$name		Name of the input variable to obtain +	 * @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. +	 * +	 * @return mixed	Value of the raw input variable +	 */ +	public function get_raw_input($name, $default); + +	/**  	 * 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 @@ -51,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  | 
