mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed Upload::isValidSize() error if a file was uploaded without an extension
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71559 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
023e733b16
commit
4e0bf2c671
@ -282,7 +282,8 @@ class Upload extends Controller {
|
||||
*/
|
||||
public function isValidSize($tmpFile) {
|
||||
$pathInfo = pathinfo($tmpFile['name']);
|
||||
$maxSize = $this->getAllowedMaxFileSize(strtolower($pathInfo['extension']));
|
||||
$extension = isset($pathInfo['extension']) ? strtolower($pathInfo['extension']) : null;
|
||||
$maxSize = $this->getAllowedMaxFileSize($extension);
|
||||
return (!$tmpFile['size'] || !$maxSize || (int)$tmpFile['size'] < $maxSize);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user