Opened 11 years ago

Closed 11 years ago

Last modified 11 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 by Aymeric Augustin, 11 years ago

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 11 years ago by Aymeric Augustin (previous) (diff)

comment:2 by Claude Paroz, 11 years ago

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

comment:3 by Florian Apolloner, 11 years ago

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

comment:4 by Aymeric Augustin, 11 years ago

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