Skip to content

Commit

Permalink
Escape the % character when used in the database password (see #61).
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jul 11, 2017
1 parent 859be17 commit 9bd4ea0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Config/ParameterDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ public function dump()
$this->parameters['parameters']['database_port'] = (int) $this->parameters['parameters']['database_port'];
}

// Escape percentage characters (see #61)
if (false !== strpos($this->parameters['parameters']['database_password'], '%')) {
$this->parameters['parameters']['database_password'] = str_replace(
'%',
'%%',
$this->parameters['parameters']['database_password']
);
}

$this->filesystem->dumpFile(
$this->rootDir.'/config/parameters.yml',
"# This file has been auto-generated during installation\n".Yaml::dump($this->parameters)
Expand Down

0 comments on commit 9bd4ea0

Please sign in to comment.