mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged [47094]: Fixes Session IP addresses in reverse order.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60546 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
af9657bd8c
commit
62d0de45d8
@ -207,10 +207,12 @@ class Session {
|
||||
public static function load_config() {
|
||||
foreach(self::$session_ips as $sessionIP => $timeout) {
|
||||
if(preg_match('/^([0-9.]+)\s?-\s?([0-9.]+)$/', $sessionIP, $ips)) {
|
||||
$minIP = ip2long($ips[1]);
|
||||
$maxIP = ip2long($ips[2]);
|
||||
$startIP = ip2long($ips[1]);
|
||||
$endIP = ip2long($ips[2]);
|
||||
$clientIP = ip2long($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
$minIP = min($startIP, $endIP);
|
||||
$maxIP = max($startIP, $endIP);
|
||||
|
||||
if($minIP <= $clientIP && $clientIP <= $maxIP) {
|
||||
return self::set_timeout($timeout);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user