Skip to content

Symfony\Component\Yaml\Inline::evaluateScalar() breaks ISO 8601 dates #6275

Closed
@bartfeenstra

Description

@bartfeenstra

Symfony\Component\Yaml\Inline::evaluateScalar() uses Symfony\Component\Yaml\Inline::getTimestampRegex() to determine whether a scalar value contains a date in what seems to be the ISO 8601 format (getTimestampRegex() is badly documented) and if it does, it converts it to a Unix timestamp.
The problem is that this conversion is conceptually impossible for a number of reasons:

  • ISO 8601 dates and Unix timestamps use different formats. Converting one to the other may break systems that expect a particular format.
  • Unix timestamps do not support dates before 1970, while ISO 8601 does. This means data loss.

Suggested solution: remove the feature entirely.

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