mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 23:59:27 -04:00
Merge pull request #58864 from nextcloud/fix/cached_exporter_hardening
This commit is contained in:
commit
3904da98e6
1 changed files with 8 additions and 1 deletions
|
|
@ -13,6 +13,8 @@ use Generator;
|
|||
use OCP\ICache;
|
||||
use OCP\ICacheFactory;
|
||||
use OCP\OpenMetrics\IMetricFamily;
|
||||
use OCP\OpenMetrics\Metric;
|
||||
use OCP\OpenMetrics\MetricValue;
|
||||
use Override;
|
||||
|
||||
/**
|
||||
|
|
@ -43,7 +45,12 @@ abstract class Cached implements IMetricFamily {
|
|||
public function metrics(): Generator {
|
||||
$cacheKey = static::class;
|
||||
if ($data = $this->cache->get($cacheKey)) {
|
||||
yield from unserialize($data);
|
||||
yield from unserialize(
|
||||
$data,
|
||||
[
|
||||
'allowed_classes' => [Metric::class, MetricValue::class],
|
||||
],
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue