Skip to content
Snippets Groups Projects
Commit 4a1bf7c7 authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[BUGFIX] Prevent infinite site settings cache recreation

Site settings rely on the Settings base class __set_state() method
to recreate the object from cache.
Since the base class used `new self` instead of `new static`,
the object received an invalid type and was therefore ignored.

Use `new static` to ensure the correct constructor is invoked.

Resolves: #104945
Related: #104858
Releases: main
Change-Id: I09eee1043902b5e62243258a080a64f026a6783e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86074


Tested-by: default avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarBenjamin Franzke <ben@bnf.dev>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
parent 4f0d4da7
Branches
Tags
No related merge requests found
......@@ -44,8 +44,9 @@ readonly class Settings implements SettingsInterface
return array_keys($this->settings);
}
public static function __set_state(array $state): self
public static function __set_state(array $state): static
{
return new self(...$state);
/** @phpstan-ignore-next-line Usage is safe because state is exported by PHP var_export() from the static instance */
return new static(...$state);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment