Small change in cgi.py 
Author Message
 Small change in cgi.py

Hi,

I would propose a small change to cgi.py module.

Currently it only unquotes the values of html form fields, after the
change it also unquotes the field names.

I collided with this problem when I tried to encode the field type into
the field name and it came back urlencoded.
('name:s' became 'name%3Aa')

so please change the row 544 from

        name  = nv[0]

to

        name  = urllib.unquote(regsub.gsub('+', ' ', nv[0]))

I hope it won't break anything (the only time it can break somtehing  is
if the field names are already urlencoded)

------------------
Hannu Krosing



Fri, 02 Jun 2000 03:00:00 GMT  
 Small change in cgi.py

Hannu Krosing:

Quote:
> I would propose a small change to cgi.py module.

> Currently it only unquotes the values of html form fields, after the
> change it also unquotes the field names.

> I collided with this problem when I tried to encode the field type into
> the field name and it came back urlencoded.
> ('name:s' became 'name%3Aa')

> so please change the row 544 from

>         name  = nv[0]

> to

>         name  = urllib.unquote(regsub.gsub('+', ' ', nv[0]))

> I hope it won't break anything (the only time it can break somtehing  is
> if the field names are already urlencoded)

Which version of cgi.py?  In 1.5b2 (the only version that matters any
more) there is no line "name = nv[0]", not on line 544 nor anywhere
else.  In fact, I do find one reference to nv[0]:

        name = urllib.unquote(regsub.gsub('+', ' ', nv[0]))

which suggests that this has already been fixed in 1.5.

--Guido van Rossum (home page: http://www.python.org/~guido/)



Fri, 02 Jun 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. python 1.5.2 cgi.py and os.py error

2. : Small improvement(?) of re.py

3. A small bug in whrandom.py

4. trying to run boa: problem with stc.py / stc_.py / stc_c.py

5. small CGI example written in Clarion

6. ANNOUNCE: Small-FCGI 0.1 -- SmallEiffel bindings for Fast CGI

7. ldap-client-cgi.py 0.5.0: WWW gateway for accessing LDAP servers

8. ldap-client-cgi.py 0.4.4: WWW gateway for accessing LDAP servers

9. ldap-client-cgi.py 0.4.1

10. ldap-client-cgi.py 0.3

11. ldap-client-cgi.py: new URL

12. New release of ldap-client-cgi.py

 

 
Powered by phpBB® Forum Software