Open Pok4 opened 2 years ago
i fixed by myself, change line to: if($options['maxSize'] && isset($file['size'][0]) && $file['size'][0] > $options['maxSize']) $errors[] = $this->error_messages['max_file_size'];
Hi,
Unfortunately this is not a fix, in fact It won't check the size correctly on server side. This code will remove the warning but will not check the size server side...
So this bug should reopened...
We waiting :)
Hi,
Here is the fix
$file['size'][0]
should be replaced by $file['size']
Replace
if($options['maxSize'] && $file['size'][0] > $options['maxSize']) $errors[] = $this->error_messages['max_file_size'];
By
if($options['maxSize'] && $file['size'] > $options['maxSize']) $errors[] = $this->error_messages['max_file_size'];
Important:
I found another error when I compared the $options['maxSize']
VS $file['size']
they use different size format so they cannot be compared
So you need to edit maxSize must be set in bytes not megabytes (because the code does not have any conversion) You need to change the value in Javascript and in PHP.
This bug can be closes now ;)
[phpBB Debug] PHP Warning: in file C:/xampp2/htdocs/App/Entity/Uploader.php on line 202: Trying to access array offset on value of type int
On line 202 i have: if($options['maxSize'] && $file['size'][0] > $options['maxSize']) $errors[] = $this->error_messages['max_file_size']; when i cjhange $file['size'][0] to @$file['size'][0] the warning disappear.
Can someone test it on php 8.1 and fix this... ?