-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Symfony version(s) affected
v6.3.0-BETA1
Description
#49331 allowed to escape [
and .
from PropertyPath strings, but the test suite was incomplete, and mostly covers the objects syntax (like foo.bar
) and not so much the array syntax (like [foo][bar]
). The author (@alanpoulain) mentioned :
I tried to modify the regexp as little as possible and to handle (really) edge cases such as double escaping.
So maybe that was intentional ? Still, I don't think this bug can be considered as an edge-case...
How to reproduce
<?php
new PropertyPath('[foo \[bar]][baz \. biz]');
throws an Exception :
Symfony\Component\PropertyAccess\Exception\InvalidPropertyPathException^ {#2696
#message: "Could not parse property path "[foo \[bar]][baz \. biz]". Unexpected token "]" at position 11."
#code: 0
#file: "./vendor/symfony/property-access/PropertyPath.php"
#line: 129
trace: {
./vendor/symfony/property-access/PropertyPath.php:129 { …}
./var/script.php:52 {
›
› dd(new PropertyPath('[foo \[bar]][baz \. biz]'));
›
arguments: {
$propertyPath: "[foo \[bar]][baz \. biz]"
}
}
}
}
Possible Solution
No response
Additional Context
No response
ostrolucky