Skip to content

Transformers edge cases: trim with a multibyte charlist, convert_value keep_missing, multi_replace and conditions with numeric keys, hash of an array, options validated with the first value #398

Closed

Description

@njoubert-cleverage

Edge cases of several transformers found by fuzzing:

  • trim: a multibyte character in charlist produces invalid UTF-8, trim() removing bytes (charlist: 'é' on "Été" gives "\x89t").
  • convert_value: with keep_missing and auto_cast, the value cast to string is returned instead of the input (true gives '1'), while the documentation promises the input itself.
  • multi_replace: a numeric key of replace_mapping ('1', '10', an int in PHP) throws a TypeError, and so does a replacement given as an array (only when transforming).
  • Conditions (ConditionTrait: filter, column_aggregator, array_filter, unset): the list form not_empty: ['[email]'], described by the documentation ("or just property path for empty and not_empty"), and a numeric key of match throw a TypeError.
  • hash: an array is hashed as the string Array, which gives the same hash for every array. A non-Stringable object throws a raw Error.
  • Options validated too late: an empty delimiter for explode, an invalid format for sprintf (e.g. a % alone) and an unknown class for instantiate are only detected with the first value, or never, depending on the data.

Found during the audit v3 (audit-v3-angles.md #198 to #203; the input policy of slugify and date_parser from #202 goes with their own tickets).

Activity

  1. added a commit that references this issue on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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