mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Validating $_FILES in Upload->validate() (Merged from r73254)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@73290 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
26b37970f8
commit
7169b9aee7
@ -165,6 +165,11 @@ class Upload extends Controller {
|
||||
// we don't validate for empty upload fields yet
|
||||
if(!isset($tmpFile['name']) || empty($tmpFile['name'])) return true;
|
||||
|
||||
if(isset($tmpFile['tmp_name']) && !is_uploaded_file($tmpFile['tmp_name'])) {
|
||||
$this->errors[] = _t('File.NOVALIDUPLOAD', 'File is not a valid upload');
|
||||
return false;
|
||||
}
|
||||
|
||||
$pathInfo = pathinfo($tmpFile['name']);
|
||||
// filesize validation
|
||||
if(!$this->isValidSize($tmpFile)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user