Cookie creation fails for localhost:XXXX hosts
-
When working from a localhost:XXXX (eg. localhost:9000) domain, the port number is not stripped when parsing HTTP_HOST, causing setcookie to fail. This renders theme switching completely unusable.
The issue is in inc/plugin-core.php on line 43:
$domain = sanitize_text_field($_SERVER['HTTP_HOST']);
Using parse_url fixes the issue:
$domain = parse_url(sanitize_text_field($_SERVER['HTTP_HOST']), PHP_URL_HOST);
Is it possible to submit a pull request for this?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Cookie creation fails for localhost:XXXX hosts’ is closed to new replies.