asikart / remoteimage

Asikart RemoteImage helps you manage Joomla CMS image and media files on local and remote FTP host.
http://ext.asikart.com/extensions/asikart-remoteimage.html
10 stars 11 forks source link

prevent uploading media files called Unicode #82

Open farhadst opened 6 years ago

farhadst commented 6 years ago

Hi I want to prevent uploading media files called Unicode in default media manager in joomla if add this code on libraries/joomla/filesystem/file.php line 68 , file named unicode not upload // Try transiterating the file name using the native php function if (function_exists('transliterator_transliterate') && function_exists('iconv')) { // Using iconv to ignore characters that can't be transliterated $file = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', $file)); }

in remoteimage, where should I put this code to do the same work

asika32764 commented 6 years ago

Remoteimage based on elFinder, the file handling is in elFinder's connection classes not in AIR.

You must find the code at here: https://github.com/asikart/remoteimage/tree/staging/admin/src/Elfinder

farhadst commented 6 years ago

I have change some code on windwalker/vendor/windwalker/filesystem/File.php but not work!

Can you help me, How do I prevent uploads of utf-8 or ascii filesname?

asika32764 commented 6 years ago

I also don't know where can modify it, I guess you can try to modify this file.

You can find the code here: https://github.com/asikart/remoteimage/blob/staging/admin/src/Elfinder/elFinderVolumeLocalFileSystem.class.php#L156