mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-15 15:58:52 +00:00
[ticket/14875] Add method for untrimmed input to ajax iohandler
Due to the pre-encoded input and the escaping of the input, the string has to be decoded twice for the password. PHPBB3-14875
This commit is contained in:
parent
145ba85d98
commit
23f5b6debd
2 changed files with 26 additions and 1 deletions
|
@ -120,6 +120,22 @@ class ajax_iohandler extends iohandler_base
|
||||||
return $this->request->variable($name, $default, $multibyte);
|
return $this->request->variable($name, $default, $multibyte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns untrimmed 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.
|
||||||
|
* @param bool $multibyte If $default is a string this paramater 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
|
||||||
|
*
|
||||||
|
* @return mixed Value of the untrimmed input variable
|
||||||
|
*/
|
||||||
|
public function get_untrimmed_input($name, $default, $multibyte = false)
|
||||||
|
{
|
||||||
|
return $this->request->untrimmed_variable($name, $default, $multibyte);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -79,10 +79,19 @@ class obtain_database_data extends \phpbb\install\task_base implements \phpbb\in
|
||||||
$dbhost = $this->io_handler->get_input('dbhost', '', true);
|
$dbhost = $this->io_handler->get_input('dbhost', '', true);
|
||||||
$dbport = $this->io_handler->get_input('dbport', '');
|
$dbport = $this->io_handler->get_input('dbport', '');
|
||||||
$dbuser = $this->io_handler->get_input('dbuser', '');
|
$dbuser = $this->io_handler->get_input('dbuser', '');
|
||||||
$dbpasswd = $this->io_handler->get_input('dbpasswd', '', true);
|
|
||||||
$dbname = $this->io_handler->get_input('dbname', '');
|
$dbname = $this->io_handler->get_input('dbname', '');
|
||||||
$table_prefix = $this->io_handler->get_input('table_prefix', '');
|
$table_prefix = $this->io_handler->get_input('table_prefix', '');
|
||||||
|
|
||||||
|
// Need to get untrimmed password when using ajax IO handler
|
||||||
|
if ($this->io_handler instanceof \phpbb\install\helper\iohandler\ajax_iohandler)
|
||||||
|
{
|
||||||
|
$dbpasswd = htmlspecialchars_decode(htmlspecialchars_decode($this->io_handler->get_untrimmed_input('dbpasswd', '', true)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$dbpasswd = $this->io_handler->get_input('dbpasswd', '', true);
|
||||||
|
}
|
||||||
|
|
||||||
// Check database data
|
// Check database data
|
||||||
$user_data_vaild = $this->check_database_data($dbms, $dbhost, $dbport, $dbuser, $dbpasswd, $dbname, $table_prefix);
|
$user_data_vaild = $this->check_database_data($dbms, $dbhost, $dbport, $dbuser, $dbpasswd, $dbname, $table_prefix);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue