Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Error in PostAuthenticationGuardToken::serialize because of bug in PHP 7.3 #29951

Copy link
Copy link
Closed
@toooni

Description

@toooni
Issue body actions

Symfony version(s) affected: 2.8.0-4.2.2 (ONLY with PHP 7.3+)

Description
A bug in PHP7.3 (https://bugs.php.net/bug.php?id=77302) which was also discussed in #29459 creates an issue where an object (sometimes?) cannot be serialized twice.
This is what happens in PostAuthenticationGuardToken::serialize / PostAuthenticationGuardToken::unserialize:

    public function serialize()
    {
        $serialized = serialize(array($this->providerKey, parent::serialize()));

        return $serialized;
    }

    public function unserialize($serialized)
    {
        list($this->providerKey, $parentStr) = unserialize($serialized);

        parent::unserialize($parentStr);
    }

Which results in an error Notice: unserialize(): Error at offset x of y bytes when using symfony guard.

How to reproduce
See https://bugs.php.net/bug.php?id=77302

Possible solution
I don't know how to fix this without a BC break. Since it's basically a PHP bug only affecting some users I also don't know how to proceed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.