User tests: Successful: Unsuccessful:
A new PR for a previous closed one:
JC tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31549
Pre update:
Can delete folders with spaces. (reproduced)
Post update:
Cannot delete folders with spaces. (test ok)
Comment: does this eror help the user?
(Unable to delete: . Directory name must only contain alphanumeric characters and no spaces.)
The folder has to be removed using ftp/file manager/ssh but error does not inform user on the how.
Not sure I understand here.
I think this PR is fine, but why do we prevent com_media from deleting stuff with spaces?
We should let com_media delete stuff with spaces and prevent indeed uploading anything with spaces imho.
This would mean also taking off the code in file.php and folder.php of type:
if ($path !== JFile::makeSafe($path))
{
$dirname = htmlspecialchars($path, ENT_COMPAT, 'UTF-8');
JError::raiseWarning(100, JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_WARNDIRNAME', substr($dirname, strlen(COM_MEDIA_BASE))));
continue;
}
I agree it would make most sense to allow managing/renaming/deleting files and folders with invalid names. But restrict the creation (or renaming to) of those folders/files.
That would be perfect.
Title |
|
Title |
|
@infograf768 PR has been updated. You also asked why to prevent deletion of stuff with spaces, I just didn't know this code was there :)
Now, test again. You will see that modifying the regex for JFile::makeSafe does not check if files are safe anymore.
What happens in the case of com_media is that the space contained in the file name will just be deleted instead of getting an alert.
For example a file "myfile 22.jpg" will be uploaded as "myfile22.jpg"
That I guess is OK for com_media, but maybe not in Joomla generally.
We have to check this before merging.
Not sure what to do with this. Probably is better to close this thing until there is some decision on what needs to be done. A discussion on the mailing list did not reach any conclusion either (https://groups.google.com/forum/#!topic/joomla-dev-cms/l-5rNCOTudE).
My intention was only to create a PR based against staging not to pull this topic. As my personal opinion is that all non-supported characters should be changed to underscores.
As discussed at the Bug Cleanup Sprint there are 2 issues here and we concluded:
Spaces are not going to be allowed to upload
Deleting images/folders with spaces should be possible.
As this is current behavior we only need to update the language string.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-07-27 17:03:51 |
@test
create map: 'Joomla\images\test test'
successful map 'test test' deleted in 'Media Manager'