Escape path before wp-config.php string replacement#5368
Merged
schlessera merged 1 commit intowp-cli:masterfrom Mar 24, 2020
Merged
Escape path before wp-config.php string replacement#5368schlessera merged 1 commit intowp-cli:masterfrom
wp-config.php string replacement#5368schlessera merged 1 commit intowp-cli:masterfrom
Conversation
schlessera
approved these changes
Mar 24, 2020
wp-config.php string replacement
Member
|
Thanks for the PR, @octalmage ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the way wp-cli modifies the wp-config.php when loading, and the fact that Windows allows single quotes in account names, a user with a single quote in their account name will get fatal errors when the wp-config.php const replacement ends up like this:
Notice the single quote in the username breaking the quoted path.
More details on this issue can be found here: #1631
This patch resolved the problem for us, and we're currently using it in a forked build. Would love to see it included in core!