mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-14 16:02:14 +09:00
Merge #1767 IPv6 사용시 /48 이상 변경되면 세션을 유지하지 않도록 변경 by kijin
* pr/1767: IPv6 사용시 /48 이상 변경되면 세션을 유지하지 않도록 변경
This commit is contained in:
commit
d446abc42b
1 changed files with 9 additions and 0 deletions
|
|
@ -203,8 +203,17 @@ class memberModel extends member
|
|||
{
|
||||
return true;
|
||||
}
|
||||
elseif(filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
|
||||
{
|
||||
// IPv6: require same /48
|
||||
if(strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// IPv4: require same /24
|
||||
if(ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8)
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue