Page 1 of 1

Make unicode folder name and filename competible

Posted: 05 Jan 2017, 08:35
by shawnhy
Hi,
I know unicode filename is DANGEROUS and we should not use it in most case.
One of my clients is eagerly need it (I am a Chinese speaker) so I need to provide them a solution.
It is not possible to ask them creating folder and uploading files via FTP, because there are dozens of users using this system, most of them are not familiar with computer.

I make some modifications to skip "Make the Filename Safe" test. And replace

Code: Select all

JRequest:: getCmd
to

Code: Select all

JRequest::getVar
On my developing environment, MacOS with apache, it works fine. But when I migrate site to CentOS machine, Phoca file manager can't display unicode. All unicode part is blank. Users can't identify files, while file can be selected without problem.

It seems $this->_tmp_folder->name in default_folder.php is not working on CentOS or what?

I am welling to take the risk using unicode and please give me a hand to make it display correctly. Thanks

Re: Make unicode folder name and filename competible

Posted: 05 Jan 2017, 21:36
by Jan
Hi, first of all, JRequest methods will be removed from Joomla! so you should test it with newest methods (in next version of Phoca Download I will add them)

e.g. instead of JRequest when getting uploaded file you should use:

Code: Select all

$file 			= JFactory::getApplication()->input->files->get( 'file', null );
standard strings:

Code: Select all

$folder			= JFactory::getApplication()->input->get( 'folder', '', '', 'path' );
Try to test these new methods. Regarding characters, I think, this needs to be somehow solved in JFilter method of Joomla! which is active when getting GET or POST variables.

Jan

Re: Make unicode folder name and filename competible

Posted: 06 Jan 2017, 06:25
by shawnhy
Hi Jan
Thank you for the very fast reply. can I hire you to do this task?