If you have a space in an image file name, it's reported as an error. The makeSafe() function is called, but returns the file name with the spaces intact. Shouldn't the spaces be removed by makeSafe(), or not reported as an error?
I expect the image file name to have the spaces removed, and the image uploaded.
The image is not uploaded, and I get this error message:
Notice File name must only contain alphanumeric characters and no spaces.
The regex expression in /library/joomla/filesystem/file.php
$regex = array('#(.){2,}#', '#[^A-Za-z0-9._- ]#', '#^.#');
could be changed to this to remove the spaces:
$regex = array('#(.){2,}#', '#[^A-Za-z0-9._-]#', '#^.#');
This is the current behavior as far as I know. I do agree with you what it would be more user friendly if it would just upload the thing.
Anyway, did you manage to check the new media manager? (still in works) http://issues.joomla.org/tracker/joomla-cms/4914
Status | New | ⇒ | Expected Behaviour |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-07-24 20:11:03 |
Closed_By | ⇒ | vdespa |
Set to "closed" on behalf of @vdespa by The JTracker Application at issues.joomla.org/joomla-cms/7489
My point is the file name scrubber, and file name validator are out of sync. Both functions should treat a space the same way. I really don't care which way the go. Either remove the space from the file name and allow the file to be saved. Or remove the space before saving.
Personally, I like to replace the spaces with hyphens (-), but that's just me.
I think this is just the way it should be. Because, if the Joomla just change the file you have no idea anymore what the name of the acual file is. So at least a message like "Spaces in the filie name are replaced to underscores (_)" or someting like that is necessary.