During file validation, we compare the uploaded file size to the permitted file size. We convert the permitted file size from KB to MB.
Conversion previously used was 1MB is 1024KB. Which led to cases where file sizes that shouldn't have passed validation, passed.
Now correctly this conversion formula to 1MB is 1000KB.
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
By adding a file exactly 5.1MB. This was previously passing the validation in place. After fix, this is properly restricted and error message is shown.
During file validation, we compare the uploaded file size to the permitted file size. We convert the permitted file size from KB to MB.
Conversion previously used was 1MB is 1024KB. Which led to cases where file sizes that shouldn't have passed validation, passed. Now correctly this conversion formula to 1MB is 1000KB.
Checklist:
How Has This Been Tested?