studio24 / wordpress-multi-env-config

WordPress multi-environment config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Over-escaping breaking wildcard domain matching

gefangenimnetz opened this issue · comments

Warning: preg_match(): Compilation failed: unmatched parentheses at offset 7 in /app/public/wp-config.load.php on line 88

The '*' should be escaped to prevent over-escaping with preg_quote (otherwise the parenthesis of str_replace would be escaped)

$match = '/' . str_replace('*', '([^.]+)', preg_quote($domain_name, '/')) . '/';

It should look like this:

$match = '/' . str_replace('\*', '([^.]+)', preg_quote($domain_name, '/')) . '/';

Regards