diff --git a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php
index edb2788910..97bdacd6bf 100644
--- a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php
+++ b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php
@@ -207,16 +207,17 @@ class FormFieldRegistry
if (preg_match('/^(?P[^[]+)(?P(\[.*)|$)/', $name, $m)) {
$segments = array($m['base']);
while (!empty($m['extra'])) {
- if (preg_match('/^\[(?P.*?)\](?P.*)$/', $m['extra'], $m)) {
+ $extra = $m['extra'];
+ if (preg_match('/^\[(?P.*?)\](?P.*)$/', $extra, $m)) {
$segments[] = $m['segment'];
} else {
- throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
+ $segments[] = $extra;
}
}
return $segments;
}
- throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
+ return [$name];
}
}