ResponsiveFilemanager icon indicating copy to clipboard operation
ResponsiveFilemanager copied to clipboard

link to image directory gives error message

Open labby opened this issue 4 years ago • 1 comments

In some cases link to image directory gives error message instead of the list of images available, One //little// fix for you "could be"

File: ~upload/modules/lib_r_filemanager/filemanager/include/php_image_magician.php Line: ~2723 if(function_exists("mime_content_type")) { $extension = mime_content_type($file); $extension = fix_strtolower($extension); $extension = str_replace('image/', '', $extension); } else { $aTemp = explode(".", $file); $sType = array_pop($aTemp); $extension = strTolower($sType); }

Sorry for bad display of code...

labby avatar Dec 13 '20 21:12 labby

I noticed this issue as well. I was getting PHP error messages when attempting to access the images directory. I never really understood this bit of code in "PHP image magician" because it doesn't analyze the MIME type for any useful reason, it just wants the file extension, so why not just use pathinfo. I replaced $extension = mime_content_type($file); with $extension = pathinfo($file, PATHINFO_EXTENSION); and it fixed the issue.

jrob007 avatar Dec 17 '20 22:12 jrob007