folding Persistance\ServerSalt into Data\Filesystem

This commit is contained in:
El RIDO
2021-06-08 22:01:29 +02:00
parent b5a6ce323e
commit 7901ec74a7
12 changed files with 80 additions and 196 deletions

View File

@@ -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;
}
}