mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6291 from dhensby/pulls/3.4/fix-uploadfield-max-size
FIX UploadField incorrectly setting max upload size
This commit is contained in:
commit
464af18346
@ -220,11 +220,6 @@ class UploadField extends FileField {
|
|||||||
$this->getValidator()->setAllowedExtensions(
|
$this->getValidator()->setAllowedExtensions(
|
||||||
array_filter(Config::inst()->get('File', 'allowed_extensions'))
|
array_filter(Config::inst()->get('File', 'allowed_extensions'))
|
||||||
);
|
);
|
||||||
|
|
||||||
// get the lower max size
|
|
||||||
$maxUpload = File::ini2bytes(ini_get('upload_max_filesize'));
|
|
||||||
$maxPost = File::ini2bytes(ini_get('post_max_size'));
|
|
||||||
$this->getValidator()->setAllowedMaxFileSize(min($maxUpload, $maxPost));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user