[Zope3-dev] Add form URL quoting

Bjorn Tillenius bjoti777 at student.liu.se
Wed Dec 1 12:10:56 EST 2004


On Wed, Dec 01, 2004 at 09:04:41AM -0700, Shane Hathaway wrote:
> This message is in reply to:
> 
> http://mail.zope.org/pipermail/zope3-checkins/2004-November/023738.html
> 
> (It's hard to reply if you don't CC me.)

Well, I replied to you, and CC:ed the list. It's hard for me to do the
other way around ;)

> We seem to be in a rather sticky situation on the add form.  In Firefox
> running in Linux, the add form didn't work if the form's URL had an "="
> character.  It broke because Zope was quoting the URL, then the browser
> quoted the URL again before sending it to the server.  By the time the
> view code saw it again, the URL was quoted one too many times.  URLs came
> out like this:
> 
> http://localhost:8080/mywiki/+/AddWikiPage.html%3Dfoo

Which version of Firefox do you use? I've tried to reproduce it, but I
couldn't. I tried Firefox 1.0 for Windows, and Firefox 0.9.3 for Linux,
no problem for me there. Also tried some versions of Opera and IE.

> So I changed Zope to unencode the URL before putting it in the form's
> action attribute.  However, Bjorn rightfully pointed out that '?' no
> longer works in object names (it's interpreted as the beginning of a query
> string).  '%' is also broken.
> 
> I can think of a few convoluted workarounds, but is there a better way to
> approach this?

I have no suggestion for a clean solution. To me it seems like a bug in
Firefox, and unexpected browser behaviour is always hard to work around.

Or... maybe it would help if we quoted '+' as well. It could be that
Firefox sees the '+' and assumes that the URL isn't quoted already. Of
course, then we probably also should quote '@'.

Regards,

Bjorn


More information about the Zope3-dev mailing list