8000 No more exception for malformed input name · symfony/symfony@953a383 · GitHub
[go: up one dir, main page]

Skip to content

Commit 953a383

Browse files
guiledfabpot
authored andcommitted
No more exception for malformed input name
1 parent a0cdcb0 commit 953a383

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Symfony/Component/DomCrawler/FormFieldRegistry.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,17 @@ private function getSegments($name)
207207
if (preg_match('/^(?P<base>[^[]+)(?P<extra>(\[.*)|$)/', $name, $m)) {
208208
$segments = array($m['base']);
209209
while (!empty($m['extra'])) {
210-
if (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $m['extra'], $m)) {
210+
$extra = $m['extra'];
211+
if (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $extra, $m)) {
211212
$segments[] = $m['segment'];
212213
} else {
213-
throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
214+
$segments[] = $extra;
214215
}
215216
}
216217

217218
return $segments;
218219
}
219220

220-
throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
221+
return [$name];
221222
}
222223
}

0 commit comments

Comments
 (0)
0