Opened 17 years ago

Closed 17 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

Description

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 17 years ago.

Download all attachments as: .zip

Change History (3)

by Chris Beaven, 17 years ago

Attachment: urlencode.patch added

comment:1 by Simon G. <dev@…>, 17 years ago

Keywords: urlencode added
Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 17 years ago

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