Skip to content

Json::reformat edge case #200

@TamasSzigeti

Description

@TamasSzigeti

Encountered an interesting edge case with the latest version.

We are generating a hash with uniqid() and testing it as part of a json with

…
                "id": "@[email protected]('/[a-z0-9]{13}/')",
…

Now in certain string literals like 5e61188283825 when it goes through Json::reformat() it fails, as the json_decode returns float infinity – interprets it as an exponential number. And then json_encode returns false which doesn't satisfy the return type, so error is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions