mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-02 20:29:21 +02:00
Code optimisations for localhost:IPv6 #17
This commit is contained in:
parent
8ebbd9c81f
commit
1946d87911
@ -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) {
|
function validate_ip($ip) {
|
||||||
$ipL = ip2long($ip);
|
$ipL = ip2long($ip);
|
||||||
$ipR = long2ip($ipL);
|
$ipR = long2ip($ipL);
|
||||||
|
|
||||||
if ($ip === $ipR) {
|
if ($ip === $ipR) {
|
||||||
return true;
|
return true;
|
||||||
|
} elseif ($ip=='::1') {
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
order deny,allow
|
order deny,allow
|
||||||
deny from all
|
deny from all
|
||||||
allow from 127.0.0.1
|
allow from 127.0.0.1 localhost ::1
|
Loading…
x
Reference in New Issue
Block a user