Description

MoinMoin does not forbid invalid page names when they're directly entered by the user.

Take this wiki for example. If I enter, literally, http://moinmoin.wikiwikiweb.de:8000/jüdelö in my browser's URL bar (firefox, set to use ISO-8859-15 as its default encoding), then firefox of course requests the URL http://moinmoin.wikiwikiweb.de:8000/j%FCdel%F6.

Obviously, that cannot work on this wiki since it isn't a valid UTF-8 pagename, however the wiki doesn't complain and tells me a page named 'j?' (where the ? is a character I can't see properly) cannot be found. try it for yourself.

Details

This Wiki.

Workaround

Discussion

Obviously, that behaviour is wrong. When I initially created the new-quoting branch I wanted it do the following:

  1. try to decode the page name as UTF-8
  2. try to decode the page name in the Accept-Charsets the browser sent

  3. if all are impossible, fail and give an error message with the opportunity to create a new page by entering the new name on a small form (then the browser has to send the name in UTF-8)

Obviously, the behavior you suggest is wrong. There is no connection between Accept-Charset and the charset the browser use for url encodings. Browsers send url in either utf-8 or another unknown encoding, that can be iso-8859-1 or anything else. You can decode any 8bit encoding as iso-8859-1 or any other 8bit encoding, so there is no point to try any 8bit encoding - all will work but will create junk.

So the behavior you suggest can be:

  1. Try utf-8
  2. Show error message with a form for entering new name

There is no standard for url encodings, and browsers behave differently:

What moin does is split the url to page names, then try to decode each from utf-8, and if thats not possible, decode the pagename with replace, so you get REPLACEMENT CHARACTER (U+FFFD). Finally, the url is joined again. For details, check request.decodePagename

The current solution let you create any valid name - name with REPLACEMENT CHARACTER (U+FFFD) is valid and encoded later using %xx. If you have problem creating names from the url box, either fix your browser configuration, or create a link on the page, then click to create the page, or use the NewPage macro:

or use the GoTo box:

In short, this is no bug, but a problem with standards that we can not solve. This is actually a feature request - a way to create names that cannot be created from the url box in certain browsers configurations. -- NirSoffer 2004-12-30 11:22:26

Plan

  • Priority:
  • Assigned to:
  • Status:


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/DoesNotForbidInvalidPageNames (last edited 2007-10-29 19:21:06 by localhost)