mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
e456de11b0
* Fix clobbering of the upload size validation When the validation is set here like this, it overrides validation which has already been setup with a simple '*' rule for the size based on PHP. If you've defined in the sites yml config something like SilverStripe\Assets\Upload_Validator: default_max_file_size: '[image]': '2m' '*' : '1m' then it will not be respected. If you review SilverStripe\Assets\Upload_Validator and check the getAllowedMaxFileSize method, you'll see the sizing will be populated (if it hasn't been done before). You can see it fail by; - Setup a new SilverStripe site. - Set your PHP to allow max post / max upload size of 10mb. - Add the above config to your sites yml file and flush. - In the CMS you'll be able to upload a 5MB file, when you shouldn't. * Test that FileField will use size validation if defined Couple of tests which prove a fix so the FileField and others will use the default_max_file_size setting * Fix variable name in last commit This is what happens when you refactor in the github window. Fix the variable names. This will get squashed once merged. * Updates the pr - white space and non deprecated method for byte conversion Remove extra white space to appease the CS. Use the non deprecated method for memstring2bytes * White space fixes for the phpcs White space fixes for the phpcs * Ensure that "memstring2bytes" can handle if an empty or value with no number is passed in * DEP Bump assets constraint to ensure that change is also pulled in --------- Co-authored-by: Guy Sartorelli <guy.sartorelli@silverstripe.com> |
||
---|---|---|
.. | ||
CheckboxFieldtest | ||
CheckboxSetFieldTest | ||
DatetimeFieldTest | ||
EmailFieldTest | ||
FormFactoryTest | ||
FormFieldTest | ||
FormRequestHandlerTest | ||
FormScaffolderTest | ||
FormSchemaTest | ||
FormTest | ||
GridField | ||
HTMLEditor | ||
ListboxFieldTest | ||
MoneyFieldTest | ||
NumericFieldTest | ||
ValidatorTest | ||
CheckboxFieldReadonlyTest.php | ||
CheckboxFieldTest.php | ||
CheckboxSetFieldMultiEnumTest.php | ||
CheckboxSetFieldTest.php | ||
CheckboxSetFieldTest.yml | ||
CompositeFieldTest.php | ||
CompositeValidatorTest.php | ||
ConfirmedPasswordFieldTest.php | ||
CurrencyFieldDisabledTest.php | ||
CurrencyFieldReadonlyTest.php | ||
CurrencyFieldTest.php | ||
DatalessFieldTest.php | ||
DateFieldDisabledTest.php | ||
DateFieldTest.php | ||
DatetimeFieldTest.php | ||
DefaultFormFactoryTest.php | ||
DisabledTransformationTest.php | ||
DropdownFieldTest.php | ||
EmailFieldTest.php | ||
EnumFieldTest.php | ||
FieldGroupTest.php | ||
FieldListTest.php | ||
FieldsValidatorTest.php | ||
FileFieldTest.php | ||
FormActionTest.php | ||
FormFactoryTest.php | ||
FormFactoryTest.yml | ||
FormFieldTest.php | ||
FormRequestHandlerTest.php | ||
FormScaffolderTest.php | ||
FormScaffolderTest.yml | ||
FormSchemaTest.php | ||
FormTest.php | ||
FormTest.yml | ||
GroupedDropdownFieldTest.php | ||
ListboxFieldTest.php | ||
ListboxFieldTest.yml | ||
LookupFieldTest.php | ||
LookupFieldTest.yml | ||
MoneyFieldTest.php | ||
NullableFieldTests.php | ||
NumericFieldTest.php | ||
OptionsetFieldTest.php | ||
PasswordFieldTest.php | ||
PopoverFieldTest.php | ||
PrintableTransformationTabSetTest.php | ||
PrintableTransformationTest.php | ||
RequiredFieldsTest.php | ||
SearchableDropdownTraitTest.php | ||
SearchableDropdownTraitTest.yml | ||
SelectionGroupTest.php | ||
SingleLookupFieldTest.php | ||
TextareaFieldTest.php | ||
TextFieldTest.php | ||
TimeFieldReadonlyTest.php | ||
TimeFieldTest.php | ||
TipTest.php | ||
TreeDropdownFieldTest.php | ||
TreeDropdownFieldTest.yml | ||
TreeMultiselectFieldTest.php | ||
ValidatorTest.php |