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

  1. Open the page boo:bar

  2. clieck on "Create new empty page"
  3. 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: External_Protocol_Request.png

Component selection

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

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/")?

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


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/PagenameContainingColumn (last edited 2011-04-09 16:44:00 by ThomasWaldmann)