mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed boundary PHP notice case in RequiredFields::php() where a field name may not be defined in the $data array when a Form is submitted
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110463 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d566ac4292
commit
8bcfa7b715
@ -103,11 +103,12 @@ JS;
|
||||
|
||||
$error = true;
|
||||
// submitted data for file upload fields come back as an array
|
||||
if(is_array($data[$fieldName])) {
|
||||
$error = ($data[$fieldName]) ? false : true;
|
||||
$value = isset($data[$fieldName]) ? $data[$fieldName] : null;
|
||||
if(is_array($value)) {
|
||||
$error = ($value) ? false : true;
|
||||
} else {
|
||||
// assume a string or integer
|
||||
$error = (strlen($data[$fieldName])) ? false : true;
|
||||
$error = (strlen($value)) ? false : true;
|
||||
}
|
||||
|
||||
if($formField && $error) {
|
||||
|
Loading…
Reference in New Issue
Block a user