mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX: Make the ./_ substitution optional.
This commit is contained in:
parent
c7c6bdebdf
commit
5dcf5197da
@ -1482,12 +1482,14 @@ class Form extends ViewableData implements HasRequestHandler
|
||||
|
||||
// Regular array access. Note that dot-syntax not supported here
|
||||
} elseif (is_array($data)) {
|
||||
// PHP turns the '.'s in POST vars into '_'s
|
||||
$name = str_replace('.', '_', $name);
|
||||
|
||||
if (array_key_exists($name, $data)) {
|
||||
$exists = true;
|
||||
$val = $data[$name];
|
||||
// PHP turns the '.'s in POST vars into '_'s
|
||||
} elseif (array_key_exists($altName = str_replace('.', '_', $name), $data)) {
|
||||
$exists = true;
|
||||
$val = $data[$altName];
|
||||
} elseif (preg_match_all('/(.*)\[(.*)\]/U', $name, $matches)) {
|
||||
// If field is in array-notation we need to access nested data
|
||||
//discard first match which is just the whole string
|
||||
|
Loading…
x
Reference in New Issue
Block a user