Wednesday, March 11, 2020
1 change · master
Resolved issues and error corrections
This fixes an issue where some uploaded files could be misidentified because they were processed as if they were base64 encoded. Users should see fewer incorrect upload errors, especially for files like spreadsheets.
Original PR description
If we pass a non base64 binary file, the function convert_to_column may not work as expected. Indeed, with b64decode, all characters that are neither in the normal base-64 alphabet nor the alternative alphabet are discarded prior to the padding check. The first decoded characters may not be representative of the original file, so the function guess_mimetype will return a wrong mimetype. For example, a .xlsx file will be detected as SVG file and an exception will be raised if the user isn't admin. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr