diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-02-17 20:32:11 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-02-17 20:32:11 +1100 |
| commit | 384996b58ac9fd9ed9cb0ca29f7febe0349a20a8 (patch) | |
| tree | 1135412174b82b4f3840f42bd3d3752ead32aa65 /inc | |
| parent | 5170cd7aa896d8ebc1f1882cb7645cb30d958c15 (diff) | |
IPv6 support
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/functions.php | 7 |
1 files changed, 7 insertions, 0 deletions
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'; |
