Commit 356b2884 authored by anarcat's avatar anarcat Committed by anarcat

resolve the hostname to find if it's local

we also now tolerate 127.0.1.1 as local
parent a299deb3
......@@ -43,7 +43,13 @@ function provision_is_local_host($host) {
// your site alias. Note that sometimes 'uname -n' does not return the
// correct value. To fix it, put the correct hostname in /etc/hostname
// and then run 'hostname -F /etc/hostname'.
return ($host == 'localhost') || ($host == '127.0.0.1') || ($host == strtolower(php_uname('n'))) || ($host == provision_fqdn());
return ($host == 'localhost') ||
($host == '127.0.0.1') ||
(gethostbyname($host) == '127.0.0.1') ||
(gethostbyname($host) == '127.0.1.1') || // common setting on
// ubuntu and friends
($host == strtolower(php_uname('n'))) ||
($host == provision_fqdn());
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment