Opened 8 years ago

Closed 7 years ago

#3155 closed defect (fixed)

[patch] urlencode filter fails when passed an integer

Reported by: SmileyChris Owned by: adrian
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: UI/UX:


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 SmileyChris 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by SmileyChris

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

  • Keywords urlencode added
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.