wp-config-transformer icon indicating copy to clipboard operation
wp-config-transformer copied to clipboard

preg_match_all fails with concatenated string

Open KBurkholder opened this issue 1 year ago • 2 comments

Bug Report

A string in wp-config.php like this:

define( 'WP_HOME', 'https://'.$_SERVER['HTTP_HOST'] );

Is not properly match in parse_wp_config() and ends up swallowing additional line(s).

The quick fix (for me) was to change to:

define( 'WP_HOME', "https://{$_SERVER['HTTP_HOST']}" );

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.

KBurkholder avatar Dec 11 '23 13:12 KBurkholder