? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
21 Feb 2020

Redo of #16878 for J4 as we do not have the same problems.
#16878 (comment)

Summary of Changes

Similar to #27974 but for media files upload

It takes advantage of the PHP extension intl when it is enabled to use the transliterator_transliterate() method, itself using ICU library.

The php extension is available since php 5.4.0, but may not be enabled on some hosts.
If disabled, former behavior is used which does not accept to upload files with UTF8 names and displays an error. This PR is therefore totally BC.

Using iconv and IGNORE let's get rid of some prime-characters that can't be transliterated, like the Cyrillic letter ь.

Testing Instructions

Check in System Information => PHP Information that the extension is enabled:
You should get something like this:

Screen Shot 2020-02-18 at 08 08 42

If it is not enabled on your local environment, try to modify your PHP.ini.

Change an image file name to utf8.
I used here '完 成'".png to be sure we also get rid of unwanted characters.

Go to Media Manager =>Upload, select the file and click upload.

'完 成'

In the case above I get a pure ascii name wan-cheng.png:

media_utf8

avatar infograf768 infograf768 - open - 21 Feb 2020
avatar infograf768 infograf768 - change - 21 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Feb 2020
Category Libraries
avatar infograf768
infograf768 - comment - 21 Feb 2020

Note: the possible messages in media manger need love & care.

avatar wilsonge wilsonge - close - 21 Feb 2020
avatar wilsonge wilsonge - merge - 21 Feb 2020
avatar wilsonge wilsonge - change - 21 Feb 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-21 10:50:48
Closed_By wilsonge
Labels Added: ?
avatar wilsonge
wilsonge - comment - 21 Feb 2020

Thankyou!

Add a Comment

Login with GitHub to post a comment