Mercurial > cpython-lru_cache-weakref
diff Lib/cgi.py @ 72990:8564d2b240b6
default - Fix closes Issue12529 - cgi.parse_header failure on double quotes and
semicolons. Patch by Ben Darnell and Petri Lehtinen.
| author | Senthil Kumaran <senthil@uthcode.com> |
|---|---|
| date | Thu, 20 Oct 2011 01:06:59 +0800 |
| parents | 66e519792e4c f5bd78b11275 |
| children | f82ebf9b3a52 |
line wrap: on
line diff
--- a/Lib/cgi.py Wed Oct 19 11:44:51 2011 +0200 +++ b/Lib/cgi.py Thu Oct 20 01:06:59 2011 +0800 @@ -300,7 +300,7 @@ while s[:1] == ';': s = s[1:] end = s.find(';') - while end > 0 and s.count('"', 0, end) % 2: + while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2: end = s.find(';', end + 1) if end < 0: end = len(s)
