From efb2c8ba7129fccce2f84791d1f4e45567aa0afb Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 13 Mar 2017 10:43:35 +0100 Subject: [PATCH] fix GET params quoting on input fields --- browser/form.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/form.py b/browser/form.py index fb8478b..33b8af4 100755 --- a/browser/form.py +++ b/browser/form.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2014 Helmut Merz helmutm@cy55.de +# Copyright (c) 2017 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ Classes for form presentation and processing. """ -from urllib import urlencode +from urllib import urlencode, unquote_plus from zope.app.container.contained import ObjectRemovedEvent from zope import component, interface, schema from zope.component import adapts @@ -182,7 +182,8 @@ class ObjectForm(NodeView): field = self.schema.fields.get(k) if field: fi = field.getFieldInstance(self.instance) - data[k] = fi.marshall(fi.unmarshall(form[k])) + input = unquote_plus(form[k]) + data[k] = fi.marshall(fi.unmarshall(input)) #data[k] = toUnicode(form[k]) return data