Code

Opened 7 years ago

Closed 4 years ago

#6129 closed (fixed)

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

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

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 PJCrosier 7 years ago.
Fix to leave tildes alone

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by PJCrosier

Fix to leave tildes alone

comment:1 Changed 7 years ago by PJCrosier

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to PJCrosier
  • Patch needs improvement unset
  • Status changed from new to assigned

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 Changed 7 years ago by PJCrosier

  • Status changed from assigned to new

comment:3 Changed 7 years ago by SmileyChris

  • Keywords flapdoodle removed
  • Triage Stage changed from Unreviewed to Design decision needed

It does look that you're right.

comment:4 Changed 4 years ago by mtredinnick

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

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

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.