Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#19532 closed Bug (invalid)

URL encoding error in set_script_prefix

Reported by: anonymous Owned by: nobody
Component: Core (URLs) Version: 1.5-beta-1
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Aymeric Augustin)

We found this as a regression bug when we switched to using django 1.5.

We were generating a fully qualified url to be used as a link within an email, by doing

set_script_prefix('http://%s' % self.domain)

The url with this prefix was generated fine with django 1.4.3, but with 1.5, the url was turned into 'http%3A...'

Change History (4)

comment:1 Changed 5 years ago by Aymeric Augustin

Description: modified (diff)
Severity: NormalRelease blocker
Type: UncategorizedBug

Clearly, this isn't the intended use of set_script_prefix.

However, we should find out which commit introduced this change and ensure that it was done for a good reason (rather than by accident).

Last edited 5 years ago by Aymeric Augustin (previous) (diff)

comment:2 Changed 5 years ago by Claude Paroz

I suppose that this behaviour was introduced in the commit [90e530978d590a5bd] that fixes #18210.

comment:3 Changed 5 years ago by Florian Apolloner

I can confirm that it was [90e530978d590a5bdcf75525aa03f844766018b8]. (Why do you have to be faster than me :/)

comment:4 Changed 5 years ago by Aymeric Augustin

Resolution: invalid
Status: newclosed

set_script_prefix isn't documented; it's a private API, not subject to the backwards-compatibility policy.

Its behavior was changed on purpose, to fix a #18210. This isn't a regression.

The URL resolver doesn't deal with the domain part; you have to include it separately in the template.

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