summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php7
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';