From 1946d87911499dd66e06dcbe6731e71f61903e41 Mon Sep 17 00:00:00 2001 From: Stefan Brannfjell Date: Sat, 8 Feb 2014 20:34:00 +0100 Subject: [PATCH] Code optimisations for localhost:IPv6 #17 --- engine/function/general.php | 4 +++- special/.htaccess | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/function/general.php b/engine/function/general.php index 98e7747..ec7a890 100644 --- a/engine/function/general.php +++ b/engine/function/general.php @@ -236,13 +236,15 @@ function validate_name($string) { } } -// Checks if an IPv4 address is valid +// Checks if an IPv4(or localhost IPv6) address is valid function validate_ip($ip) { $ipL = ip2long($ip); $ipR = long2ip($ipL); if ($ip === $ipR) { return true; + } elseif ($ip=='::1') { + return true; } else { return false; } diff --git a/special/.htaccess b/special/.htaccess index 608da1a..8fdc8aa 100644 --- a/special/.htaccess +++ b/special/.htaccess @@ -1,3 +1,3 @@ order deny,allow deny from all -allow from 127.0.0.1 \ No newline at end of file +allow from 127.0.0.1 localhost ::1 \ No newline at end of file