?
avatar Kimball31
Kimball31
21 Jul 2015

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?

Steps to reproduce the issue:

  • Upload an image file with spaces in the filename to see the error.

Expected result

I expect the image file name to have the spaces removed, and the image uploaded.

Actual result

The image is not uploaded, and I get this error message:

Notice
File name must only contain alphanumeric characters and no spaces.

System information (as much as possible)

  • PHP 5.3.29
  • Joomla 3.4.3

Additional comments

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._-]#', '#^.#');

avatar Kimball31 Kimball31 - open - 21 Jul 2015
avatar n9iels
n9iels - comment - 21 Jul 2015

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.

avatar vdespa
vdespa - comment - 24 Jul 2015

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


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

avatar vdespa vdespa - change - 24 Jul 2015
Status New Expected Behaviour
Closed_Date 0000-00-00 00:00:00 2015-07-24 20:11:03
Closed_By vdespa
avatar vdespa
vdespa - comment - 24 Jul 2015

Set to "closed" on behalf of @vdespa by The JTracker Application at issues.joomla.org/joomla-cms/7489

avatar joomla-cms-bot joomla-cms-bot - close - 24 Jul 2015
avatar joomla-cms-bot joomla-cms-bot - close - 24 Jul 2015
avatar Kimball31
Kimball31 - comment - 24 Jul 2015

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.


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

Add a Comment

Login with GitHub to post a comment