Closed frankiejarrett closed 6 years ago
@schlessera I haven't had a chance to really dig in to root cause yet, so it's unclear whether this is a problem in the transformer or config command itself, but based on what I was experiencing it seemed like the transformer.
I've been able to reproduce this report.
based on what I was experiencing it seemed like the transformer.
Yes. If the Success:
output is correct, which it is, then the problem is within the transformer.
The culprit is:
$contents = preg_replace( sprintf( '/(?<=^|;|<\?php\s|<\?\s)%s/m', preg_quote( $old_src, '/' ) ), $new_src, $this->wp_config_src );
Specifically, $12345
is interpreted as a placeholder instead of a direct replacement.
When a
$
symbol immediately followed by a digit is used inside a value, what stdout reports doesn't match what actually gets put into thewp-config.php
file.I'd consider this an urgent problem for anyone generating random passwords or salts with the potential for a
$[0-9]
pattern to exist.These work fine ($ not immediately followed by a digit)