mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-23 01:03:16 +01:00
The file size check was comparing bytes (from dol_filesize) directly with kilobytes (from MAIN_SECURITY_MAXFILESIZE_DOWNLOADED config), causing false positives that blocked downloads of small files. Example: A 94 KB file (96678 bytes) was rejected because 96678 > 20480, even though the limit was actually 20480 KB (20 MB). Changes: - Convert KB limit to bytes before comparison: $fileSizeMax * 1024 - Improve error message to display file size in KB for consistency - Add detailed logging with both bytes and KB values Fixes: Files under the configured limit are now correctly allowed to download