Should Joomla! allow folder names with spaces

508 views
Skip to first unread message

rolandd

unread,
May 31, 2014, 11:43:38 AM5/31/14
to joomla-...@googlegroups.com
Hey guys,

There is an interesting issue tracker:

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31549&start=250

It talks about that Joomla generates an error message that folder names should not contain any spaces but the makeSafe($file) method does allow spaces. Spaces are of course accepted in folder names nowadays.

Either we should decide not to allow spaces at all and fix the makeSafe($file) method to filter them out or if we decide to allow spaces, we should update the language files as they currently say that Joomla doesn't allow spaces:

COM_MEDIA_ERROR_UNABLE_TO_DELETE_FOLDER_WARNDIRNAME="Unable to delete: %s. Directory name must only contain alphanumeric characters and no spaces."

Let's decide and clean this up once and for all.

Regards,

Roland

Richard McDaniel

unread,
May 31, 2014, 12:56:03 PM5/31/14
to joomla-...@googlegroups.com
Thanks for looking into this issue. I think it is best to let the operating system decide whether or not a filename is valid and to allow spaces whenever the OS does. Is there a reason why Joomla can't support both?

Bakual

unread,
Jun 1, 2014, 3:06:31 AM6/1/14
to joomla-...@googlegroups.com
I think the original idea for not allowing spaces is that they aren't allowed in an URL. As soon as the file or folder becomes part of an URL (like an image or JS file), it shouldn't contain spaces to avoid problems.

Leo Lammerink

unread,
Jun 1, 2014, 4:17:06 AM6/1/14
to joomla-...@googlegroups.com
Also all editors would have to be modified since JCE won't allow spaces in the creation of links for instance.

rolandd

unread,
Jun 2, 2014, 4:47:46 AM6/2/14
to joomla-...@googlegroups.com
URLs can have spaces just no literal spaces but having no spaces in URLs is probably a better idea as it reduces the chance of broken links and all kind of other problems.

Let's move this bug report forward and not allow spaces in folder names. This way we do not have to change the behavior of editors either.

Thanks for all the feedback.

Nathan Hawks

unread,
Jun 2, 2014, 4:52:54 AM6/2/14
to joomla-...@googlegroups.com
Is it possible limited devices which might run joomla in the near future would have limitations along this line?

I ask this because my old Maemo device kicked around removing almost a dozen characters from its symbol maps including brackets, parens... it read like an April Fool's joke (just think how geek-focused the Nokia N-series handhelds were).

Also, food for thought from Wikipedia's ISO 9660 article:

All levels restrict filenames to upper case letters, digits, underscores ("_"), and a dot. Linux by default [2] converts uppercase letters to lower case while mounting ISO filesystems.

What? Really? (Text search "name restrictions" on that page.)

I think it needs to be platform-derived behavior.

Nathan Hawks

unread,
Jun 2, 2014, 4:54:12 AM6/2/14
to joomla-...@googlegroups.com
Disregard my prior - I've no reason to argue with a conservative decision here.

Sergio Manzi

unread,
Jun 2, 2014, 7:00:14 AM6/2/14
to joomla-...@googlegroups.com
Pardon the joke, but... why don't we limit ourselves to 8+3 ASCII characters, possibly uppercase?

Being more serious: I'm not sure, but maybe this can have implications with URL in scripts other than Latin.
Personally I'm always against imposing limitations: let's stick to the standards.
If today there are limits in the editors, that doesn't means they will forever be: they could (and probably should) be fixed and I think we don't wont to become the limiting factor at the point in time.

Regards,
smz
--
You received this message because you are subscribed to the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-cm...@googlegroups.com.
To post to this group, send email to joomla-...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-cms.
For more options, visit https://groups.google.com/d/optout.

Bakual

unread,
Jun 2, 2014, 7:16:09 AM6/2/14
to joomla-...@googlegroups.com
According to http://www.ietf.org/rfc/rfc1738.txt, spaces are considered "unsafe" characters within an URL and should be encoded.
So technically they are indeed allowed, but it will likely get problems if the file ends up in an unencoded URL. I don't think we always encoded those within Joomla, so it may be better to avoid using spaces in the first place.
That's of course only an argument if we are talking about media assets like pictures, scripts, css files and the like. If we are talking about the media manager, that's exactly where that would be the case. However JFile and JFolder are also used for other purposes where that isn't a problem and where spaces would be perfectly fine.

Richard McDaniel

unread,
Jun 2, 2014, 9:31:52 AM6/2/14
to joomla-...@googlegroups.com
As far as I can tell, nobody has given a solid reason for disallowing spaces. I've seen questions but nothing definitive. On the other hand, I have a website where users are uploading images and creating folders via FTP client which allows them to use spaces. This causes issues with media manager refusing to browse certain folders for no good reason. Does anyone have an actual specific reason why we shouldn't allow spaces in file and folder names?


On Saturday, May 31, 2014 10:43:38 AM UTC-5, rolandd wrote:

joomlagate

unread,
Jun 2, 2014, 6:05:06 PM6/2/14
to joomla-...@googlegroups.com

hi,

 

I think, there SHOULD be some limitations always to avoid vital mistake.

Will you allow a common public visitor register the username “admin” or “administrator” on your website? If no, then you are not against this limitation.

I like the “reserved words” rule, it can prevent many problems.

 

So, I also STRONGLY AGAINT space in folder names and file names on the web server! Don’t want to argue more, it is so clear that there should be some limitation on this naming rule.

 

Just post to show my vote on this topic:

 

Joomla SHOULD NOT allow space in folder name!

 

Thanks.

baijianpeng

http://www.joomlagate.com/

 

 

 

From: joomla-...@googlegroups.com [mailto:joomla-...@googlegroups.com] On Behalf Of Sergio Manzi
Sent: Monday, June 02, 2014 7:00 PM
To: joomla-...@googlegroups.com
Subject: Re: [jcms] Re: Should Joomla! allow folder names with spaces

 

Sergio Manzi

unread,
Jun 2, 2014, 7:52:26 PM6/2/14
to joomla-...@googlegroups.com
Well, I sincerely think you are comparing apple and oranges when you make a parallel between security or policy related blacklists and the space-yes/space-no issue.

Honestly, I don't like spaces in filenames and URL at all, mostly because they get shown with the horrible %20, but I know from experience that there are a lot of images out in the wild with spaces in their names.

At the end of the day, from a practical point of view, you know what I'll do? I will go and see what WP, Drupal, Wix, eZ Publish, TYPO3, Blogger, Tumbler, Opencart, concrete5 and whatever other CMS comes to my mind do at this regard: if there is global trend against/pro spaces in file names, then I'll follow that trend.

Regards,
smz

Nathan Hawks

unread,
Jun 2, 2014, 8:37:35 PM6/2/14
to joomla-...@googlegroups.com
This topic may be bike-shed at this point. 

The code should be consistent, so the OP's issue (inconsistent handling & docs) should be resolved one way or the other.

Otherwise if it becomes advantageous to target a device which needs this restriction, it stops being bike shed.

Bigger more immediate fish to fry at the end of the day.


--
You received this message because you are subscribed to a topic in the Google Groups "Joomla! CMS Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/joomla-dev-cms/l-5rNCOTudE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to joomla-dev-cm...@googlegroups.com.

rolandd

unread,
Jun 3, 2014, 1:13:57 AM6/3/14
to joomla-...@googlegroups.com
| Honestly, I don't like spaces in filenames and URL at all, mostly because they get shown with the horrible %20, but I know from experience that there are a lot of images out in the wild with spaces in their names.

Actually, this made me think. I agree the %20 is ugly as can be. What we could do is replace the spaces in uploaded filenames with underscores. This has a few advantages, users are not being bothered by errors that their file has spaces and we solve the space problem in URLs.

Is that something we could pursue?

Bakual

unread,
Jun 3, 2014, 4:20:09 AM6/3/14
to joomla-...@googlegroups.com
While probably most modern browsers can access those URLs fine, there are issues with accessing URLs containing spaces when we're talking about accessing them using JavaScript code and the like. Also there may be issues with other devices and clients.
According to the standards, those URLs should be encoded so it works properly.

I would actually like to enforce the "no spaces" rule and I in fact already do it in my own component. However I do not change files uploaded by FTP. They still work and you can do everything with it on your own risk. But I show a warning message that the filename is unsafe.
Maybe we can do something similar in the media manager. Don't allow files and folders to be created with spaces, but still allow to browse, rename, delete, ...,  them if they were created using FTP. Show a warning message instead explaining good practices.

Nathan Hawks

unread,
Jun 3, 2014, 12:19:19 PM6/3/14
to joomla-...@googlegroups.com
Chiming in in case anyone's taking notes because I'd like to see this done someday, but I still think it might be shelve-able for now.

If this is done, the help strings for file name validation, and the code for file name validation, FTP access, direct disk access, and of course uploading would need brought in line so that the behavior cascaded throughout the process correctly. Also, some small mod for TinyMCE would probably need be part of this conditional. 

Trapping for name collisions if a file is renamed such that it would overwrite an existing file or folder may also be necessary.

Small changes each but needs covered in several places and there may be other touchpoints than these.


--
Reply all
Reply to author
Forward
0 new messages