Reply to file_safe_name adding extra characters

file_safe_name adding extra characters new!
by Steven, 7 years, 6 months ago
Hello,

I'm having a problem renaming a file named "Améliorations.pdf".
It always gets renamed to "AmeYliorations.pdf". Everytime there's an accented character, a capital Y appears after.

I've isolated the script and took it out of the class and when I pass the same string, I get the correct output (Ameliorations.pdf).

I've added some more debug info in the log for the safe rename.
The extra Y is added when the class executes utf8_encode.

The script file is saved as UTF8.

Anyone has an idea why? Thank you.

LOG BELOW

system information
- class version : 0.34dev
- operating system : Darwin
- PHP version : 5.6.10
- GD version : 2.1.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 32M (33554432 bytes)
- language : fr_FR
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
MAGIC path will not be used
MIME type detected as application/pdf; charset=binary by Fileinfo PECL extension
- MIME validated as application/pdf
source variables
- You can use all these before calling process()
file_src_name : Améliorations.pdf
file_src_name_body : Améliorations
file_src_name_ext : pdf
file_src_pathname : /Applications/MAMP/tmp/php/phpSsoY0W
file_src_mime : application/pdf
file_src_size : 104646 (max= 33554432)
file_src_error : 0
process file to public/media/products/1/
- file size OK
- file mime OK : application/pdf
- before safe name: Améliorations
- after utf8_encode: AmeYliorations
- after strtr: AmeYliorations
- file name safe format
- destination variables
file_dst_path : public/media/products/1/
file_dst_name_body : AmeYliorations
file_dst_name_ext : pdf
- checking for auto_rename
- destination file details
file_dst_name : AmeYliorations.pdf
file_dst_pathname : public/media/products/1/AmeYliorations.pdf
- AmeYliorations.pdf doesn't exist already
- no image processing wanted
- process OKReply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important