angular-filemanager icon indicating copy to clipboard operation
angular-filemanager copied to clipboard

Special web-unsafe characters will not be escaped during upload.

Open jrondorf opened this issue 9 years ago • 13 comments

By accident, I uploaded a picture with a special character (like "–", a longer hyphen, see http://unicode-table.com/en/2013/) in it.

This resulted in a file, which was not able to be previewed, nor deleted. Is there a place where this could be encoded?

jrondorf avatar Jun 18 '16 19:06 jrondorf

Hi,

I had similiar problems with some local characters but so I guess I need to take a look whether it happens on the frontend or in the bridge.

durasj avatar Jun 20 '16 11:06 durasj

Hi.. @jrondorf this happens with php (ftp bridge) or php-local bridge?

Regards

joni2back avatar Jul 28 '16 12:07 joni2back

Hello @durasj ! I tested in php bridge and works well, maybe your bridge have a encoding issue with some characters. Did you try to use some utf8_encode(), mb_convert_encoding() functions to parse filename?

Regards

joni2back avatar Jul 28 '16 12:07 joni2back

Hi, with PHP Local Bridge.

jrondorf avatar Jul 28 '16 13:07 jrondorf

Hi guys,

unfortunately I can't look at it in the near future as I have too much work. Please, feel free to look at it.

Thank you very much

durasj avatar Jul 30 '16 11:07 durasj

If you are able to point me to a place in the source code, I can have a look. This is an important functionality, which I need. Thanks.

jrondorf avatar Jul 30 '16 20:07 jrondorf

Hi @jrondorf,

here it is: https://github.com/joni2back/angular-filemanager/blob/master/bridges/php-local/LocalBridge/FileManagerApi.php#L345

Also manual page for chmod and it's comments could be useful: http://php.net/manual/en/function.chmod.php

Thanks

durasj avatar Aug 03 '16 14:08 durasj

@durasj Seems your links and response its for another issue :)

joni2back avatar Aug 03 '16 19:08 joni2back

@joni2back you are absolutely right. Sorry about that, I've been quite busy lately.

I am afraid I can't point you in this case as it will probably require changes all over the code.

durasj avatar Aug 04 '16 09:08 durasj

So isn't there just one place where you are uploading files, where the filename can be checked? Of course in addition also the download/viewing of files has to be adapted, but upload of new files is more important.

jrondorf avatar Aug 04 '16 09:08 jrondorf

My code is pretty straightforward. All the important logic is happening in the FileManagerApi.php file within *Action methods like uploadAction

durasj avatar Aug 04 '16 09:08 durasj

@durasj if the filename having the Captial letters then script removes the capital letters.

yogeshdalavi77 avatar Jan 06 '18 12:01 yogeshdalavi77

Hi @yogeshdalavi77

I think this issue was resolved by implementing normalizeName. Please check the linked method to see whether it causes the issue. I am not the author.

I think the correct behavior should be lowercasing them, but feel free to play with it and let me know.

durasj avatar Jan 07 '18 13:01 durasj