[Security] fixed a fatal error when upgrading from 4.2
This commit is contained in:
parent
7f43878d9c
commit
cd63446f9b
@ -199,7 +199,15 @@ abstract class AbstractToken implements TokenInterface
|
||||
*/
|
||||
public function __unserialize(array $data): void
|
||||
{
|
||||
[$this->user, $this->authenticated, $this->roles, $this->attributes, $this->roleNames] = $data;
|
||||
[$this->user, $this->authenticated, $this->roles, $this->attributes] = $data;
|
||||
|
||||
// migration path to 4.3+
|
||||
if (null === $this->roleNames = $data[4] ?? null) {
|
||||
$this->roleNames = [];
|
||||
foreach ($this->roles as $role) {
|
||||
$this->roleNames[] = (string) $role;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user