No more exception for malformed input name
This commit is contained in:
parent
a0cdcb0ffb
commit
953a3835a2
@ -207,16 +207,17 @@ class FormFieldRegistry
|
|||||||
if (preg_match('/^(?P<base>[^[]+)(?P<extra>(\[.*)|$)/', $name, $m)) {
|
if (preg_match('/^(?P<base>[^[]+)(?P<extra>(\[.*)|$)/', $name, $m)) {
|
||||||
$segments = array($m['base']);
|
$segments = array($m['base']);
|
||||||
while (!empty($m['extra'])) {
|
while (!empty($m['extra'])) {
|
||||||
if (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $m['extra'], $m)) {
|
$extra = $m['extra'];
|
||||||
|
if (preg_match('/^\[(?P<segment>.*?)\](?P<extra>.*)$/', $extra, $m)) {
|
||||||
$segments[] = $m['segment'];
|
$segments[] = $m['segment'];
|
||||||
} else {
|
} else {
|
||||||
throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
|
$segments[] = $extra;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $segments;
|
return $segments;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \InvalidArgumentException(sprintf('Malformed field path "%s"', $name));
|
return [$name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user