mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-21 22:17:44 -04:00
ensure PHP opcache gets invalidated, when storing data in file parsed via PHP require
This commit is contained in:
@@ -204,16 +204,10 @@ class TrafficLimiter extends AbstractPersistence
|
||||
$now = time();
|
||||
$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;
|
||||
} else {
|
||||
$tl = time();
|
||||
$result = true;
|
||||
}
|
||||
if (!self::$_store->setValue((string) $tl, 'traffic_limiter', $hash)) {
|
||||
error_log('failed to store the traffic limiter, it probably contains outdated information');
|
||||
}
|
||||
if ($result) {
|
||||
if ($tl === 0 || ($tl + self::$_limit) < $now) {
|
||||
if (!self::$_store->setValue((string) $now, 'traffic_limiter', $hash)) {
|
||||
error_log('failed to store the traffic limiter, it probably contains outdated information');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
throw new Exception(I18n::_(
|
||||
|
||||
Reference in New Issue
Block a user