File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/Symfony/Component/Form/Util
tests/Symfony/Tests/Component/Form Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public function __construct($propertyPath)
64
64
$ remaining = $ propertyPath ;
65
65
66
66
// first element is evaluated differently - no leading dot for properties
67
- $ pattern = '/^((\w +)|\[([^\]]+)\])(.*)/ ' ;
67
+ $ pattern = '/^(([^\.\[] +)|\[([^\]]+)\])(.*)/ ' ;
68
68
69
69
while (preg_match ($ pattern , $ remaining , $ matches )) {
70
70
if ($ matches [2 ] !== '' ) {
Original file line number Diff line number Diff line change @@ -48,6 +48,15 @@ public function testGetValueReadsIndexWithSpecialChars()
48
48
$ this ->assertEquals ('Bernhard ' , $ path ->getValue ($ array ));
49
49
}
50
50
51
+ public function testGetValueReadsElementWithSpecialCharsExceptDOt ()
52
+ {
53
+ $ array = array ('#!@$ ' => 'Bernhard ' );
54
+
55
+ $ path = new PropertyPath ('#!@$ ' );
56
+
57
+ $ this ->assertEquals ('Bernhard ' , $ path ->getValue ($ array ));
58
+ }
59
+
51
60
public function testGetValueReadsNestedIndexWithSpecialChars ()
52
61
{
53
62
$ array = array ('root ' => array ('#!@$. ' => 'Bernhard ' ));
You can’t perform that action at this time.
0 commit comments