Opened 12 years ago

Closed 12 years ago

#3155 closed defect (fixed)

[patch] urlencode filter fails when passed an integer

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords: urlencode
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


My code which is failing:

<a href="...?id={{ user_id|urlescape }}">

user_id is sometimes an integer (when pulled from database), which caused urlescape to fail.

I could just str() it in the view, but it shouldn't really matter. The simple patch converts to a string if it isn't one already.

Attachments (1)

urlencode.patch (448 bytes) - added by Chris Beaven 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by Chris Beaven

Attachment: urlencode.patch added

comment:1 Changed 12 years ago by Simon G. <dev@…>

Keywords: urlencode added
Triage Stage: UnreviewedReady for checkin

comment:2 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [4496]) Fixed #3155 -- Allow an integer to be passed to the urlencode filter. Patch
based on one from SmileyChris.

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