CMS MADE SIMPLE FORGE

TinyMCE

 

[#12549] Insert file does not work with php 8

avatar
Created By: Adrian von Muralt (Callisto58)
Date Submitted: Fri Jun 17 08:57:43 -0400 2022

Assigned To: Rolf (rolf1)
Version: 3.3.2
CMSMS Version: 2.2.16
Severity: Critical
Resolution: None
State: Open
Summary:
Insert file does not work with php 8
Detailed Description:
When I want to insert a file or image, only an empty window appears in the file
upload window (insert file / filemanager).


History

Comments
avatar
Date: 2023-01-23 10:08
Posted By: antibart (Steph)

With this modifications it works for me:

STEP 1:

modules/TinyMCE/responsive_filemanager/filemanager/config/config.php

Line 9:

replace

mb_http_input('UTF-8');

with:

mb_http_input();

After doing that you will see the download files again instead of the empty pop
up. But trying to upload new files will give an error such as "saveImage: This
is not a resource". So go to step 2.

STEP 2:

modules/TinyMCE/responsive_filemanager/filemanager/include/php_image_magician.php

Line 2791:

replace:

if ( ! is_resource($this->imageResized))

with:

if ( ! is_resource($this->imageResized) && !($this->imageResized instanceof
\GdImage))
      
avatar
Date: 2023-11-28 07:57
Posted By: Fernando Morgado (JoMorg)

mb_http_input('I'); aparently works fine
      
avatar
Date: 2024-06-18 20:01
Posted By: Sam Mah (sammah0224)

Hi Antibart
Thanks for helping us out.

I  have used your solution, but I encountered additional issues. Can you please
shed some lights on these items:

php_image_magician.php on line 493

$this->keepTransparancy($optimalWidth, $optimalHeight, $crop);
imagecopyresampled($crop, $this->imageResized, 0, 0, $cropStartX, $cropStartY,
$newWidth, $newHeight, $newWidth, $newHeight);

-------------------------------------
Deprecated: usort(): Returning bool from comparison function is deprecated,
return an integer less than, equal to, or greater than zero in line 754
        usort($sorted, 'filenameSort');

------------------
Fatal error: Uncaught Error: Call to undefined method
imageLib::imagecreatefromwebp() in filemanager\include\php_image_magician.php on
line 2742

case 'webp':
					$img = @$this->imagecreatefromwebp($file);
					break;


Any help is greatly appreciated.