Description
Under google chrome, IE (6 and maybe ) and firefox, it is not possible to edit page which name match [a-z]+:.
Some other links are affected too, like <link rel="Alternate" ...>
Steps to reproduce
Open the page boo:bar
- clieck on "Create new empty page"
- click on the preview button
Example
URL: http ://wiki.debian.org/Aptitude::Parse-Description-Bullets%3Dtrue?action=edit&editor=text
When you click Preview, you get an error like:
Component selection
- general
Details
MoinMoin Version |
1.9 |
OS and Version |
Debian Squeeze |
Python Version |
- |
Server Setup |
- |
Server Details |
- |
Language you are using the wiki in (set in the browser/UserPreferences) |
En |
Workaround
A blank before the :: http://moinmo.in/Aptitude %3A%3AParse-Description-Bullets
or something like that http://moinmo.in/Aptitude%C2%AD::Parse-Description-Bullets
Discussion
When editing a page, MoinMoin create a form like:
<form id="editor" method="post" action="foo:bar#preview" onSubmit="flgChange = false;">
But when the editor click on "preview" or "save", Google chrome consider that foo: is a protocol, and try to launch the associated application. As a consequence, it is not possible to edit page which name starts with [a-z]+: (It can even get worse on some system, which will use the external command xdg-open to try to launch unknown protocol... it may have security impact, but that's another story)
If we escape the :: by %3A%3A this also makes trouble in firefex. firefox can do the page creation dialog but can't save
This happens in this wiki too.
It fails with a protocol error "Aptiude unknown"
Would it work if URL where prefixed with something (like "/" or "/4ct10n/")?
- It did not work in this wiki, so we missed something to prefix here or - no.
This is how moin creates that URL using werkzeug:
>>> import werkzeug as w >>> h = w.Href('/') >>> h <werkzeug.utils.Href object at 0xb7340f2c> >>> h('foo') '/foo' <--- ok >>> h('foo:bar') 'foo:bar' <--- resulting in browser trying wrong protocol >>> h('a&o') '/a%26o' <--- ok >>> h(u'übel') '/%C3%BCbel' <--- ok
Possible solution:
>>> import werkzeug as w >>> h = w.Href('/') >>> h('./foo:bar') '/foo:bar' >>> h = w.Href('/xxxx') >>> h('./foo:bar') '/xxxx/foo:bar' >>> h = w.Href('/xxxx/') >>> h('./foo:bar') '/xxxx/foo:bar' >>> h = w.Href('http://server/xxxx/') >>> h('./foo:bar') 'http://server/xxxx/foo:bar'
Thanks to Armin Ronacher for suggesting this!
I filed a werkzeug bug about this, let's see what happens:
https://github.com/mitsuhiko/werkzeug/issues#issue/46
Plan
- Priority:
- Assigned to:
Status: duplicate of MoinMoinBugs/PageEditorAndPageNamesWithColons