Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 953a383

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

File tree

1 file changed

+4
-3
lines changed
Filter options

1 file changed

+4
-3
lines changed

‎src/Symfony/Component/DomCrawler/FormFieldRegistry.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/FormFieldRegistry.php
+4-3Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.