-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"wp config create" generates wrong DB_PASSWORD in wp-config.php when db password has " #180
Comments
Thanks for the report, @schplurtz ! Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices. |
Looks like we have used Ref: https://github.com/wp-cli/config-command/blob/main/src/Config_Command.php#L1204-L1206
|
I'm glad to se that there is activity on this bug report, although I fail to see how a problem with single quote (#93) is in any way related to this problem with double quote that are escaped but should not. PHP rules for escaping inside single quotes are so simple : only escape |
PR #181 adds a fix for the issue. Also takes care of #94 Related: wp-cli/wp-cli#5955 |
Tested with success. PR #181 fixes the issue. |
Reopening because #181 was reverted for the time being |
If you use " in your your string it should generate the same what you get. |
Bug Report
Describe the current, buggy behavior
If db password has
"
, thenwp config create --dbpass='abcd"efgh' --other...
will create a wrongDB_PASSWORD
line inwp-config.php
. The resulting line is:This is wrong. There should not be the
\
Describe how other contributors can replicate this bug
"
in the password. eg these sql commands:wp config create
. This is where wp generates the wrong lineDescribe what you would expect as the correct outcome
The
"
on theDB_PASSWORD
line should not be escaped. Given the above commands, theDB_PASSWORD
line in wp-config.php should read:Let us know what environment you are running this on
Provide a possible solution
Not a solution, but I found 2 workarounds:
"
in db password, obviouslywp config set
afterwards. Strangely, it generates a correct line in wp-config.php.The text was updated successfully, but these errors were encountered: