Make unicode folder name and filename competible

Phoca Download - download manager
shawnhy
Phoca Member
Phoca Member
Posts: 25
Joined: 04 Nov 2012, 08:22

Make unicode folder name and filename competible

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Make unicode folder name and filename competible

Post 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
If you find Phoca extensions useful, please support the project
shawnhy
Phoca Member
Phoca Member
Posts: 25
Joined: 04 Nov 2012, 08:22

Re: Make unicode folder name and filename competible

Post by shawnhy »

Hi Jan
Thank you for the very fast reply. can I hire you to do this task?
Post Reply