pagename "download" in lang=en -> Error 404

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

pagename "download" in lang=en -> Error 404

Post by svasti » Fri Dec 26, 2014 2:03 am

Just seeing a very strange phenomenon:

German website with English secondary language, and in the English part it is not possible to call a page "download"???
The online editor is not shown, instead one finds this notice (view mode and edit mode):
CMSimple_XH 1.6.4 wrote:Error 404: Not found
File ../userfiles/downloads/true
(on my local host php 5.2.5 as well as on the server php 5.3.18-nmm1)

Changing the pagename to "Download" makes everything well again. Too bad, the client wants "download"...

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: pagename "download" in lang=en -> Error 404

Post by cmb » Fri Dec 26, 2014 2:50 am

svasti wrote:German website with English secondary language, and in the English part it is not possible to call a page "download"???
That would not even be possible in the German part. The problem is that CMSimple reserves several page names for special use. I had pointed out this issue in http://cmsimpleforum.com/viewtopic.php? ... =10#p35873 (even though I was not aware of this particular issue, and the suggestions seem unsatisfactory for me now). IMO the whole handling of the "page URLs" has to be reconsidered (for XH 2.0?)

For now there are several workarounds, one of which (or a combination thereof) might be viable:
  • using the "alternative heading"
  • moving the page to the second menu level
  • deploying an URL rewrite (mod_rewrite for Apache)
  • using an invisible character (such as ZERO WIDTH SPACE)
  • removing "download" from the special handling (cmsimple/cms.php line 530ff)
  • trying to convince the client that English titles usually start with an upper case letter
  • using CSS text-transform
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: pagename "download" in lang=en -> Error 404

Post by svasti » Fri Dec 26, 2014 5:57 pm

cmb wrote:The problem is that CMSimple reserves several page names for special use.
I wasn't aware of that. Would be nice if XH would give some other response instead of "Error 404: Not found
File ../userfiles/downloads/true"
Could this behavior be considered a bug? The user cannot change the name without using the pagemanager or using direct file editing.
Would it be possible to have a different behaviour e.g. automatic change of the pagename to: "PAGENAME <reserved name> not allowed. Use another name."?

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: pagename "download" in lang=en -> Error 404

Post by cmb » Sat Dec 27, 2014 12:14 am

svasti wrote:Could this behavior be considered a bug? The user cannot change the name without using the pagemanager or using direct file editing.
Indeed, the behavior of "download" is worse than "sitemap", "print", etc. I tend to regard it as a bug.
svasti wrote:Would it be possible to have a different behaviour e.g. automatic change of the pagename to: "PAGENAME <reserved name> not allowed. Use another name."?
Yes, but I'm not sure if it wouldn't break some plugins. It seems to be appropriate to investigate the issue more thoroughly, having a look at other such variables, too. Actually, I wonder why initvar() is called on parameters which don't expect values (such as print, images, etc.), and why initvar() doesn't ignore parameters without any value.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply