Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#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)

utf8-safe-redirect_to.patch (2.5 KB ) - added by Chris Adams 13 years ago.

Download all attachments as: .zip

Change History (6)

by Chris Adams, 13 years ago

Attachment: utf8-safe-redirect_to.patch added

comment:2 by Julien Phalip, 13 years ago

Triage Stage: UnreviewedReady for checkin

Good catch, thanks!

comment:3 by Julien Phalip, 13 years ago

Resolution: fixed
Status: newclosed

In [17034]:

Fixed #17111 -- Made the redirect_to generic view properly handle query strings with percent symbols. Thanks, Chris Adams.

comment:4 by anonymous, 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 Claude Paroz, 13 years ago

Seems the class-based generic view suffered from the same problem. Fix happens in #16842.

Note: See TracTickets for help on using tickets.
Back to Top