Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over-escaping breaking wildcard domain matching #29

Closed
gefangenimnetz opened this issue Jul 6, 2018 · 0 comments
Closed

Over-escaping breaking wildcard domain matching #29

gefangenimnetz opened this issue Jul 6, 2018 · 0 comments

Comments

@gefangenimnetz
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant