?
avatar okonomiyaki3000
okonomiyaki3000
6 Nov 2014

Steps to reproduce the issue

Go the media manager and upload an image with an @ in the name like:
filename@2x.jpg

I suppose I don't need to tell you why you might want to do this actually.

Expected result

The file will be uploaded with its name intact.

Actual result

The @ sign is stripped. Because MediaControllerFile calls JFile::makeSafe() which remove any slightly interesting characters from the file name.

System information (as much as possible)

Doesn't matter.

Additional comments

https://en.wikipedia.org/wiki/Filename

avatar okonomiyaki3000 okonomiyaki3000 - open - 6 Nov 2014
avatar Bakual
Bakual - comment - 6 Nov 2014

The @ symbol is a valid character for a filename. However it's a reserved character in an URI, and thus shouldn't be used for filenames which end up as part of an URI.
See RFC 3986 Section 2.2 for reserved characters and 2.3 for unreserved ones.

Characters that are allowed in a URI but do not have a reserved
purpose are called unreserved. These include uppercase and lowercase
letters, decimal digits, hyphen, period, underscore, and tilde.

So, the media manager does act correct because it tries to make the filenames safe to use in an URL.
Closing this as expected behavior.

avatar Bakual Bakual - close - 6 Nov 2014
avatar Bakual Bakual - change - 6 Nov 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-11-06 07:10:51
avatar Bakual
Bakual - comment - 6 Nov 2014

Interesting indeed. So Apple hacked a feature into their iOS which is basically against an RFC as I understand it.

I reopen the issue then since it seems to be a requirement for Apple devices.

avatar Bakual Bakual - reopen - 6 Nov 2014
avatar Bakual Bakual - change - 6 Nov 2014
Status Closed New
avatar infograf768
infograf768 - comment - 6 Nov 2014

As explained in #4995 mailcloak would create unwanted results of we allow this.

avatar VNiemi
VNiemi - comment - 7 Nov 2014

I mentioned this in the emailcloak thread referenced, but the RFC says to use percent encoding. So the media manager so do that to URI reserved characters. Whether that would work, is another question. But it IS the expected way to handle weird characters in filenames.

avatar zero-24 zero-24 - change - 9 Nov 2014
Category Media Manager
avatar jens333
jens333 - comment - 26 Nov 2014

What about using the urlencode() function?
In joomla.filesystem.file there could be a function like:

    public static function makeURL($file)
    {
        // Remove any trailing dots, as those aren't ever valid file names.
        $file = rtrim($file, '.');

        return urlencode($file);
    }

which is then called to save the uploaded file in the filesystem without "weird" characters:

    $file['name']     = JFile::makeURL($file['name']);

...or is called by makeSafe() in the first place.

If it is taken serious, the encoded filenames are for "internal" use and should be decoded with urldecode() when displaying the filename for the user, or building them into something else.

avatar okonomiyaki3000
okonomiyaki3000 - comment - 26 Nov 2014

No.

avatar brianteeman brianteeman - change - 3 Jan 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 9 May 2015
Status New Needs Review
avatar zero-24
zero-24 - comment - 9 May 2015

Moving to Needs Review so a Maintainer can decide if this should changed or not. Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5001.

avatar roland-d
roland-d - comment - 24 Sep 2015

The PLT has decided not to implement this change and keep the current behavior. Thank you for your contribution.

avatar roland-d roland-d - change - 24 Sep 2015
Status Needs Review Closed
Closed_Date 2014-11-06 07:10:51 2015-09-24 16:29:25
Closed_By roland-d
avatar roland-d roland-d - close - 24 Sep 2015

Add a Comment

Login with GitHub to post a comment