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.
The file will be uploaded with its name intact.
The @ sign is stripped. Because MediaControllerFile calls JFile::makeSafe() which remove any slightly interesting characters from the file name.
Doesn't matter.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-11-06 07:10:51 |
Interesting. Well, somebody should tell these guys:
https://developer.apple.com/library/ios/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreensInViews/SupportingHiResScreensInViews.html#//apple_ref/doc/uid/TP40010156-CH15-SW1
and this guy:
https://imulus.github.io/retinajs/
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5001.
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.
Status | Closed | ⇒ | New |
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.
Category | ⇒ | Media Manager |
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.
No.
Labels |
Added:
?
|
Status | New | ⇒ | Needs Review |
Moving to Needs Review
so a Maintainer can decide if this should changed or not. Thanks.
The PLT has decided not to implement this change and keep the current behavior. Thank you for your contribution.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 2014-11-06 07:10:51 | ⇒ | 2015-09-24 16:29:25 |
Closed_By | ⇒ | roland-d |
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.
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.