trippo / ResponsiveFilemanager

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

Upload error in PHP 8.1 #709

Open seunex17 opened 1 year ago

seunex17 commented 1 year ago

I am having problem uploading image in PHP 8.1 it works on older version. The main issue is i can not event see the actual error this is what i am getting.

image

junefw commented 1 year ago

I have same issue when upgrade php 8.2.0. hope fix it soon

junefw commented 1 year ago

@seunex17 Hey, you can follow fixed this issue https://github.com/trippo/ResponsiveFilemanager/issues/673 reply by faisalrehmanlums

I have two step to fixed:

  1. At this file: /filemanager/config/config.php Replace mb_http_input('UTF-8') with mb_http_input();

  2. At saveImage function in this file: filemanager/include/php_image_magician.php Change: if ( ! is_resource($this->imageResized)) To: if ( ! is_resource($this->imageResized) && !($this->imageResized instanceof \GdImage))

*Note: enable GD extention extension=gd in php.ini Done.

seunex17 commented 1 year ago

@junefw thanks

mcsaygili commented 1 year ago

Same issue for PHP 8.2.5 Any updates ?

mcsaygili commented 1 year ago

Fixed.

satriags commented 1 year ago

it's works !! thank youu

slaweknaczynski commented 11 months ago

Fixed.

  • dialog.php change str_replace(['[', ']'], ['\[', '\]'], $field_id'') to str_replace(['[', ']'], ['\[', '\]'], $field_id ?? '')
  • php_image_magician.php change $cropStartX = $cropArray['x']; $cropStartY = $cropArray['y']; to $cropStartX = (int)$cropArray['x']; $cropStartY = (int)$cropArray['y'];
  • UploadHandler.php add protected $response;

Why don't you do pull request with those changes so that owner can merge it into master for others to use instead of applying manually? I can see owner merged some pull requests this year? Thanks

dleffler commented 5 months ago

Not yet fixed in the code here. Though there's fixes above the error is in /include/php_image_magician.php whereby the floating point parameters ($cropStartX & $cropStartY are not recommended for the imagecopyresampled() call. I simply added an '(int)' type cast to each parameter and the 'warning' no longer spits out which causes the above error. (See #718)