Fixes broken file uploads
This commit is contained in:
parent
7c5693b298
commit
6bac3f9251
|
|
@ -47,7 +47,7 @@ class FileUpload extends FormWidgetBase
|
||||||
/**
|
/**
|
||||||
* @var mixed Collection of acceptable file types.
|
* @var mixed Collection of acceptable file types.
|
||||||
*/
|
*/
|
||||||
public $acceptedFileTypes;
|
public $acceptedFileTypes = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
|
@ -128,10 +128,13 @@ class FileUpload extends FormWidgetBase
|
||||||
*/
|
*/
|
||||||
public function getAcceptedFileTypes($includeDot = false)
|
public function getAcceptedFileTypes($includeDot = false)
|
||||||
{
|
{
|
||||||
if (!$types = $this->acceptedFileTypes) {
|
$types = $this->acceptedFileTypes;
|
||||||
$types = starts_with($this->getDisplayMode(), 'image')
|
if ($types === false && starts_with($this->getDisplayMode(), 'image')) {
|
||||||
? 'jpg,jpeg,bmp,png,gif,svg'
|
$types = 'jpg,jpeg,bmp,png,gif,svg';
|
||||||
: null;
|
}
|
||||||
|
|
||||||
|
if (is_null($types)) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($types)) {
|
if (!is_array($types)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue