minor #41567 [Security] Fix SerializableUser fixture (derrabus)
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Fix SerializableUser fixture
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
That's hopefully the last `Serializable` implementation we need to fix. 😓
Commits
-------
8fbf3bb3c7
[Security] Fix SerializableUser fixture
This commit is contained in:
commit
a850da562b
@ -322,12 +322,22 @@ class SerializableUser implements UserInterface, \Serializable
|
|||||||
|
|
||||||
public function serialize(): string
|
public function serialize(): string
|
||||||
{
|
{
|
||||||
return serialize($this->name);
|
return serialize($this->__serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function unserialize($serialized): void
|
public function unserialize($serialized): void
|
||||||
{
|
{
|
||||||
$this->name = unserialize($serialized);
|
$this->__unserialize(unserialize($serialized));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __serialize(): array
|
||||||
|
{
|
||||||
|
return ['name' => $this->name];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __unserialize(array $data): void
|
||||||
|
{
|
||||||
|
['name' => $this->name] = $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user