Skip to content

Conversation

schlessera
Copy link
Member

This PR adds byte-order marks (BOM) detection to the logic that parses the wp-config.php file for loading WP within the WP-CLI context.

If a BOM is detected, WP-CLI issues a warning and then strips that BOM for further parsing.

_ 2022-01-05 at 11 52 24 AM li-dev_wp-cli

Fixes #5577
Fixes #5578

@schlessera schlessera added this to the 2.5.1 milestone Jan 5, 2022
@schlessera schlessera requested a review from a team as a code owner January 5, 2022 17:58
@schlessera schlessera force-pushed the fix/5578-detect-and-strip-bom-in-wp-config.php branch from cbe60f3 to 7357ff9 Compare January 5, 2022 20:00
@schlessera schlessera force-pushed the fix/5578-detect-and-strip-bom-in-wp-config.php branch from 7357ff9 to 44eb815 Compare January 6, 2022 16:04
@schlessera schlessera merged commit ef28288 into master Jan 6, 2022
@schlessera schlessera deleted the fix/5578-detect-and-strip-bom-in-wp-config.php branch January 6, 2022 23:22
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.

Detect and warn about BOM in wp-config.php Can't run WP-CLI: PHP Parse error: syntax error, unexpected '?'
2 participants