@specialk
Hey, thanks for the follow up!
I just checked and it works fine now. Thanks!
I think you could avoid any regression for current users with the following solution:
By default, use the current code to parse the host:
$domain = sanitize_text_field($_SERVER['HTTP_HOST']);
Then, check for the existence of a port number in the URL with parse_url:
$port = parse_url($domain, PHP_URL_PORT);
If a port number exists, assume the domain is a local URL and parse the host name with parse_url:
if (!empty($port)) {
$domain = parse_url($domain, PHP_URL_HOST);
}
What do you think?
-
This reply was modified 4 years, 11 months ago by the8thcelljr.
-
This reply was modified 4 years, 11 months ago by the8thcelljr.