IPv6 support

This commit is contained in:
Savetheinternet 2011-02-17 20:32:11 +11:00
parent 5170cd7aa8
commit 384996b58a
2 changed files with 11 additions and 4 deletions

View file

@ -668,7 +668,14 @@
return false;
}
function isIPv6() {
return strstr($_SERVER['RETMOTE_ADDR'], ':') !== false;
}
function isTor() {
if(isIPv6())
return false; // Tor does not support IPv6
return gethostbyname(
ReverseIPOctets($_SERVER['REMOTE_ADDR']) . '.' . $_SERVER['SERVER_PORT'] . '.' . ReverseIPOctets($_SERVER['SERVER_ADDR']) . '.ip-port.exitlist.torproject.org'
) == '127.0.0.2';