mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Better checking of file validity (#6093) Thanks Pigeon
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113419 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fe26454567
commit
e2d4dc25dc
@ -105,7 +105,12 @@ JS;
|
|||||||
// submitted data for file upload fields come back as an array
|
// submitted data for file upload fields come back as an array
|
||||||
$value = isset($data[$fieldName]) ? $data[$fieldName] : null;
|
$value = isset($data[$fieldName]) ? $data[$fieldName] : null;
|
||||||
if(is_array($value)) {
|
if(is_array($value)) {
|
||||||
$error = ($value) ? false : true;
|
if ($formField instanceof FileField && isset($value['error']) && $value['error']) {
|
||||||
|
$error = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$error = (count($value)) ? false : true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// assume a string or integer
|
// assume a string or integer
|
||||||
$error = (strlen($value)) ? false : true;
|
$error = (strlen($value)) ? false : true;
|
||||||
|
Loading…
Reference in New Issue
Block a user