folding Persistance\ServerSalt into Data\Filesystem
This commit is contained in:
@@ -172,7 +172,7 @@ class TrafficLimiter extends AbstractPersistence
|
||||
// this hash is used as an array key, hence a shorter algo is used
|
||||
$hash = self::getHash('sha256');
|
||||
$now = time();
|
||||
$tl = self::$_store->getValue('traffic_limiter', $hash);
|
||||
$tl = (int) self::$_store->getValue('traffic_limiter', $hash);
|
||||
self::$_store->purgeValues('traffic_limiter', $now - self::$_limit);
|
||||
if ($tl > 0 && ($tl + self::$_limit >= $now)) {
|
||||
$result = false;
|
||||
@@ -180,7 +180,7 @@ class TrafficLimiter extends AbstractPersistence
|
||||
$tl = time();
|
||||
$result = true;
|
||||
}
|
||||
self::$_store->setValue((string) $tl, 'traffic_limiter');
|
||||
self::$_store->setValue((string) $tl, 'traffic_limiter', $hash);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user