Open KBurkholder opened 11 months ago
Thanks for the report, @KBurkholder !
Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices.
@danielbachhuber I've been playing around with updating the RegEx rules over here at https://regex101.com/r/ArEndA/1. It seems like I've managed to get it working in this scenario, but I've been unsuccessful trying to implement it in the source code. I'm unfamiliar with how the tests work here, especially since it seems like they're dynamically generating the file fixtures. 🤔
Out of curiousity, have we considered to parse it into AST with something like nikic/PHP-Parser? It may be more reliable than using RegEx to cover more scenarios.
Bug Report
A string in wp-config.php like this:
Is not properly match in parse_wp_config() and ends up swallowing additional line(s).
The quick fix (for me) was to change to:
But that doesn't change things in the wild.
You can see this by pasting the line in the regex101 before the
/* That's all, stop editing! Happy blogging. */
line.