Opened 9 years ago

Closed 9 years ago

#4075 closed (fixed)

The url template tag incorrectly includes the '?' character found in a urls.py regex when producing urls.

Reported by: justin.vanwinkle@… Owned by: Adrian Holovaty
Component: Template system Version: master
Severity: Keywords: url question-mark regex template
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Malcolm Tredinnick)

The template tag

{% url example_edit %}

produces

http://localhost:8000/wiki/example/add/?

for the urls.py entry

url(r'^wiki/example/add/?$', example_edit, name="example_edit")

it should produce

http://localhost:8000/wiki/example/add/

since the '?' is a regex operator in this context.

Change History (5)

comment:1 Changed 9 years ago by Chris Beaven

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

I'm pretty sure this is actually a problem with the current core.urlresolvers.reverse - see #2977

comment:2 Changed 9 years ago by Malcolm Tredinnick

Description: modified (diff)

Fixed summary formatting.

comment:3 Changed 9 years ago by Chris Beaven

Resolution: duplicate
Status: newclosed

I'll mark as a dupe, #2977 addresses this.

comment:4 Changed 9 years ago by Rafael

Cc: Excellent web site I will be visiting ofteno added
Component: Template systemCache system
Keywords: %0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0AExcellent+web+site+I+will+be+visiting+ofteno added; url question-mark regex template removed
Resolution: duplicate
Status: closedreopened
Summary: The url template tag incorrectly includes the '?' character found in a urls.py regex when producing urls.%250D%250A%250D%250A%250D%250A%250D%250A%250D%250A%250D%250AExcellent%2Bweb%2Bsite%2BI%2Bwill%2Bbe%2Bvisiting%2Bofteno
Triage Stage: AcceptedDesign decision needed
Version: SVNunicode

%25250D%25250A%25250D%25250A%25250D%25250A%25250D%25250A%25250D%25250A%25250D%25250AExcellent%252Bweb%252Bsite%252BI%252Bwill%252Bbe%252Bvisiting%252Bofteno

comment:5 Changed 9 years ago by Russell Keith-Magee

Cc: Excellent web site I will be visiting ofteno removed
Component: Cache systemTemplate system
Keywords: url question-mark regex template added; %0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0AExcellent+web+site+I+will+be+visiting+ofteno removed
Resolution: fixed
Status: reopenedclosed
Summary: %250D%250A%250D%250A%250D%250A%250D%250A%250D%250A%250D%250AExcellent%2Bweb%2Bsite%2BI%2Bwill%2Bbe%2Bvisiting%2BoftenoThe url template tag incorrectly includes the '?' character found in a urls.py regex when producing urls.
Triage Stage: Design decision neededAccepted
Version: unicodeSVN

Reverted blog spam

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