yii2-attachments
yii2-attachments copied to clipboard
Bug \nemmo\attachments\Module Line140 pathinfo renturn '' when filename is chinese.
$file->name = pathinfo($filePath, PATHINFO_FILENAME);
-> $filePath='D:/test/中文文件名测试.jpg'
-> the $file->name is empty.
Maybe you should use setlocale
function?
http://php.net/manual/ru/function.setlocale.php
change the code like this?
How does it work? Why do you add '_' in chinese?
because if without _ the chinese file name will be empty
In Module.php remove is ok
I understood that it will be empty. I dont understant why?
P.S Your pull request is not correct. You removes the first character every time. But what about the filename, for example, 1.jpg
? It will be .jpg
, so I think that you are not right.
I have another change you can see it in the picture. I just forgot to commit it. change fiel FileController
I could not catch that error, closing issue
Bug http://stackoverflow.com/questions/4451664/make-php-pathinfo-return-the-correct-filename-if-the-filename-is-utf-8