Skip to content

Commit

Permalink
Merge pull request #965 from brandung-sjorek/fix/escape-username-and-…
Browse files Browse the repository at this point in the history
…password-in-mysql-command/latest
  • Loading branch information
helhum committed Feb 22, 2021
2 parents d544baf + f14bf1d commit caef614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Console/Database/Process/MysqlCommand.php
Expand Up @@ -141,10 +141,10 @@ private function createTemporaryMysqlConfigurationFile()
$userDefinition = '';
$passwordDefinition = '';
if (!empty($this->dbConfig['user'])) {
$userDefinition = sprintf('user="%s"', $this->dbConfig['user']);
$userDefinition = sprintf('user="%s"', addcslashes($this->dbConfig['user'], '"\\'));
}
if (!empty($this->dbConfig['password'])) {
$passwordDefinition = sprintf('password="%s"', $this->dbConfig['password']);
$passwordDefinition = sprintf('password="%s"', addcslashes($this->dbConfig['password'], '"\\'));
}
$confFileContent = <<<EOF
[mysqldump]
Expand Down

0 comments on commit caef614

Please sign in to comment.