trippo / ResponsiveFilemanager

Completely Responsive Filemanager with integration for tinyMCE,CKEditor and CLEditor editor
http://responsivefilemanager.com
Other
808 stars 368 forks source link

Error in php 8 (on newest ubuntu docker image) at get_unique_filename when upload image #656

Closed tuanva-hw closed 3 years ago

tuanva-hw commented 3 years ago

image

Error
Warning: Trying to access array offset on value of type null in /var/www/html/api/public/media/UploadHandler.php on line 497

Warning: Trying to access array offset on value of type null in /var/www/html/api/public/media/UploadHandler.php on line 1431
{"files":[{"name":"a (1).jpg","size":84698,"type":"image\/jpeg","url":"http:\/\/api.webbase.local\/files\/media\/base\/999f323a415cccc39eba96321d7345f5a888ed8d\/a%20%281%29.jpg","deleteUrl":"http:\/\/api.webbase.local\/media\/upload.php?file=a%20%281%29.jpg","deleteType":"DELETE","error":"saveImage: This is not a resource."}]}

I can skip this error by change $uploaded_bytes = $this->fix_integer_overflow((int)$content_range[1]); =>

 $tmp = 0;
  if ($content_range && $content_range[1]) $tmp = $content_range[1];
  $uploaded_bytes = $this->fix_integer_overflow($tmp);

but still get an error :saveImage: This is not a resource The image was uploaded to the base folder but can not upload to the thumb folder

tuanva-hw commented 3 years ago

AW! I can run it now in php_image_magican.php change ! is_resource($this->imageResized => ! $this->imageResized instanceof \GdImage