forked from leftypol/leftypol
IPv6 support
This commit is contained in:
parent
5170cd7aa8
commit
384996b58a
2 changed files with 11 additions and 4 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue