Fix creating UploadFormField without any restrictions
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Mar 2019 13:32:01 +0000 (15:32 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Mar 2019 13:32:01 +0000 (15:32 +0200)
See #2509
See #2825

wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php

index 821ea4495db2e2ec299101844d98b9e407e75d5b..72b43c3800237011c4817595e6b3e115e56634e9 100644 (file)
@@ -69,7 +69,9 @@ class UploadFormField extends AbstractFormField {
                $uploadField = new UploadField($this->getPrefixedId());
                $uploadField->maxFiles = $this->getMaximum();
                $uploadField->setImageOnly($this->isImageOnly());
-               $uploadField->setAllowSvgImage($this->svgImageAllowed());
+               if ($this->isImageOnly()) {
+                       $uploadField->setAllowSvgImage($this->svgImageAllowed());
+               }
                
                return $uploadField;
        }