Thanks to visit codestin.com
Credit goes to github.com

Skip to content

JsonResponse setCallback throws InvalidArgumentException on valid callback #17923

Closed
@Spaggel

Description

@Spaggel

Using Symfony 3.0, trying to set a callback on a JsonResponse fails for the following callback: Utils.callbacks[1].

The pattern in setCallback ^[$_\p{L}] $_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u fails on anything containing brackets while this could be a valid callback.

This works for me ^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\.]*+(\x{5b}\S+\x{5d})*$. This allows callbacks like foo.bar[1] but not foo.bar[].

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