Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accented characters are completely removed #14

Open
ajoah opened this issue Dec 6, 2018 · 5 comments
Open

Accented characters are completely removed #14

ajoah opened this issue Dec 6, 2018 · 5 comments
Assignees
Labels

Comments

@ajoah
Copy link

ajoah commented Dec 6, 2018

Version information

  • Plugin version : 2.0.6
  • PHP : 7.2
  • WordPress : 4.9.8

Steps to reproduce

  1. Upload a file with a name which contains an accented character like noël.jpg

What was expected

The file renamed to noel.jpg

What happened instead

The file renamed to nol.jpg

The problem is appeared on v2.0.6 and I think it is comes from 54a0944 commit.

@ajoah
Copy link
Author

ajoah commented Dec 6, 2018

I added comments on 54a0944

@MaximeCulea MaximeCulea self-assigned this Dec 10, 2018
@MaximeCulea
Copy link
Contributor

Thank you @ajoah for the report.

I've been digging into this. It seems that a file

noël.jpg
is not working with version 2.0.5 nor 2.0.6.

Here what happens for me :
image

I will be looking soon this strange issue a little bit more.
Thx

@ajoah
Copy link
Author

ajoah commented Dec 11, 2018

Indeed strange... From my tests, v2.0.5 works well.. (I am on Windows 10) Tested on my websites and on an online sandbox with only the plugin installed.

@MaximeCulea
Copy link
Contributor

MaximeCulea commented Dec 19, 2018

I have done others tests and it has always failed with the accentuated ë, formatted from a mac, because the encoding format is stored into the filename attributes unlike other filesystem.

I need to check http://php.net/manual/fr/function.utf8-encode.php to see what I can get.
More info about file system : http://php.net/manual/en/function.stat.php

@ajoah
Copy link
Author

ajoah commented Mar 27, 2019

Hi @MaximeCulea

I did some tests and sorry but i don't understand the purpose of this commit : 54a0944 (added on bea-sanitize-filename v2.0.6)

What issue do this commit fixes?

I created a file on Mac OS Sierra Virtual machine with bea-sanitize-filename v2.0.5 : ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ.jpg (The same characters as those added in the commit)
I have uploaded it to WP.
Result : aaaaaaceeeeiiiiooooouuuuyaaaaaaceeeeiiiidooooouuuuyy.jpg

(Tested on a poopy.life sandbox with only your plugin installed. (v2.0.5))

Except the ð transformed in d, it is perfect 👍

On v2.0.6, all theses characters are deleted, result : unnamed-file.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants