Opened 16 years ago

Closed 14 years ago

#6129 closed (fixed)

"url" template-tag incorrectly encodes tilde (~) character in urls

Reported by: moe Owned by: Pete Crosier
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The "url" template-tag encodes the tilde (~) character in urls
although it is a legal ("unreserved") URL character since
1995, cf. RFC2396.

RFC2396 (1995): http://www.cs.tut.fi/~jkorpela/rfc/2396/full.html
RFC3986 (2005): http://www.rfc-editor.org/rfc/rfc3986.txt

This causes uglyness in the adressbar when a django app
wants to support the common http://server/~username/ URL-style.

Django should stick to the RFC and only encode characters
that must be encoded.

Attachments (1)

6129.django.utils.encoding.diff (415 bytes ) - added by Pete Crosier 16 years ago.
Fix to leave tildes alone

Download all attachments as: .zip

Change History (5)

by Pete Crosier, 16 years ago

Fix to leave tildes alone

comment:1 by Pete Crosier, 16 years ago

Has patch: set
Owner: changed from nobody to Pete Crosier
Status: newassigned

I've attached a simple patch.. is it really this simple or am I missing something, would be good to get a professional opinion :D

comment:2 by Pete Crosier, 16 years ago

Status: assignednew

comment:3 by Chris Beaven, 16 years ago

Keywords: flapdoodle removed
Triage Stage: UnreviewedDesign decision needed

It does look that you're right.

comment:4 by Malcolm Tredinnick, 14 years ago

Resolution: fixed
Status: newclosed

This is definitely a safe change to make and was already fixed in r12066 (along with a couple of other characters).

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