#17111 closed Bug (fixed)
simple redirect_to: handle query strings with percent symbols
Reported by: | Chris Adams | Owned by: | cadams |
---|---|---|---|
Component: | Generic views | Version: | 1.3 |
Severity: | Normal | Keywords: | i18n |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
If you use django.views.generic.simple.redirect_to with query_string=True and the query string contains a % character followed a valid Python conversion character it will cause a TypeError later when url % kwargs
is performed. This is particularly easy to encounter when your content includes things like UTF-8 escaped content as the leading %C3 will trigger reliably trigger a TypeError.
Attachments (1)
Change History (6)
by , 13 years ago
Attachment: | utf8-safe-redirect_to.patch added |
---|
comment:1 by , 13 years ago
comment:4 by , 13 years ago
Thanks for the fix, acdha. I set up redirect_to earlier today, was getting errors immediately from users, and am happy to see a quick fix!
comment:5 by , 13 years ago
Seems the class-based generic view suffered from the same problem. Fix happens in #16842.
Current code is also available at https://github.com/acdha/django/tree/17111-utf8-safe-redirect_to