Skip to content
Snippets Groups Projects
Commit 2ce81ab6 authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Andreas Fernandez
Browse files

[BUGFIX] Fix serialization of ObjectManager

The PSR-11 container instance was not cleared upon serialization which
caused an exception when Closures in the container where tried to be
serialized.

__wakeup() does already contain code to reset the container instance,
therefore we only need to clear the entire object manager properties
in __sleep().

Releases: master
Resolves: #91398
Related: #88689
Change-Id: I58202752577b58cd882d13f471af1e045c9a4187
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64489


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarAlexander Schnitzler <git@alexanderschnitzler.de>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarAlexander Schnitzler <git@alexanderschnitzler.de>
Reviewed-by: default avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: default avatarSusanne Moog <look@susi.dev>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent d685d021
Branches
Tags
No related merge requests found
......@@ -62,13 +62,9 @@ class ObjectManager implements ObjectManagerInterface
* @return array Names of the properties to be serialized
* @internal only to be used within Extbase, not part of TYPO3 Core API.
*/
public function __sleep()
public function __sleep(): array
{
// Use get_objects_vars() instead of
// a much more expensive Reflection:
$properties = get_object_vars($this);
unset($properties['objectContainer']);
return array_keys($properties);
return [];
}
/**
......
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