From 384996b58ac9fd9ed9cb0ca29f7febe0349a20a8 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 17 Feb 2011 20:32:11 +1100 Subject: IPv6 support --- inc/functions.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index eccdc4ee..14733ec8 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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'; -- cgit v1.3