8000 [Security] fixed a fatal error when upgrading from 4.2 by fabpot · Pull Request #31566 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] fixed a fatal error when upgrading from 4.2 #31566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Security] fixed a fatal error when upgrading from 4.2
  • Loading branch information
fabpot authored and nicolas-grekas committed May 21, 2019
commit cd63446f9b42e0284b5e6765e72054840d0c42c3
Original file line number Diff line number Diff line chan 6DF5 ge
Expand Up @@ -199,7 +199,15 @@ public function serialize()
*/
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;
}
}
}

/**
Expand Down
0