1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

Merge branch '3.2.x'

* 3.2.x:
  [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
This commit is contained in:
Tristan Darricau
2016-12-03 12:33:05 +01:00
7 changed files with 114 additions and 36 deletions

View File

@@ -120,6 +120,14 @@ class ajax_iohandler extends iohandler_base
return $this->request->variable($name, $default, $multibyte);
}
/**
* {@inheritdoc}
*/
public function get_raw_input($name, $default)
{
return $this->request->raw_variable($name, $default);
}
/**
* {@inheritdoc}
*/

View File

@@ -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;

View File

@@ -38,10 +38,21 @@ 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

View File

@@ -79,7 +79,7 @@ class obtain_database_data extends \phpbb\install\task_base implements \phpbb\in
$dbhost = $this->io_handler->get_input('dbhost', '', true);
$dbport = $this->io_handler->get_input('dbport', '');
$dbuser = $this->io_handler->get_input('dbuser', '');
$dbpasswd = $this->io_handler->get_input('dbpasswd', '', true);
$dbpasswd = $this->io_handler->get_raw_input('dbpasswd', '');
$dbname = $this->io_handler->get_input('dbname', '');
$table_prefix = $this->io_handler->get_input('table_prefix', '');