Opened 11 years ago

Closed 11 years ago

#1266 closed defect (wontfix)

Default filter URLENCODE enhacement

Reported by: mordaha Owned by: Adrian Holovaty
Component: Template system Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Old style:

var = "123/123"

{{ var|urlencode }}

produces output:
123/123

New style:

{{ var|urlencode:"" }}

produces output:
123%4F123

{{ var|urlencode:"/" }}

produces output:
123/123

New code:

def urlencode(value, arg=''):
    "Escapes a value for use in a URL"
    import urllib
    return urllib.quote(value, arg)

Change History (1)

comment:1 Changed 11 years ago by Adrian Holovaty

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top