Skip to content

Conversation

octalmage
Copy link
Contributor

@octalmage octalmage commented Mar 17, 2020

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:

/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
        define( 'ABSPATH', 'C:\Users\local's\Local Sites\dickens-llc\app\public' . '/' );
}

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!

@octalmage octalmage requested a review from a team as a code owner March 17, 2020 15:22
@schlessera schlessera added this to the 2.5.0 milestone Mar 24, 2020
@schlessera schlessera changed the title fix: Escape path before wp-config.php string replacement. Escape path before wp-config.php string replacement Mar 24, 2020
@schlessera schlessera merged commit 54c4dac into wp-cli:master Mar 24, 2020
@schlessera
Copy link
Member

Thanks for the PR, @octalmage !

@octalmage octalmage deleted the windows-apostrophe branch April 1, 2020 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants