Opened 7 years ago

Closed 7 years ago

#11252 closed (fixed)

Invalid XHTML when filtering a paginated list

Reported by: daemondazz Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The admin sites generates invalid XHTML when viewing a filtered list of objects and that list needs to be paginated. The invalid tags are the links for jumping to different pages in the result set which have query string like "?p=2&domain__exact=1" instead of "?p=2&domain__exact=1".

This manifests if the site has

DEFAULT_CONTENT_TYPE = 'application/xhtml+xml'

set in the settings file: Firefox displays an error message about the invalid XHTML code and is not able to show the page.

The culprit in this case is passing the results of urllib.urlencode directly back to the HTML without fixing the amperstands.

Patch to be attached in a moment.

Attachments (2)

django_admin_pagination_fixamperstands.patch (1.2 KB) - added by daemondazz 7 years ago.
Patch to wrap the return of urllib.urlencode in fix_amperstands
django_admin_pagination_escape.patch (788 bytes) - added by daemondazz 7 years ago.
Updated patch using escape()

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by daemondazz

Patch to wrap the return of urllib.urlencode in fix_amperstands

comment:1 Changed 7 years ago by Chris Beaven

Needs documentation: unset
Needs tests: unset
Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Version: 1.0SVN

Should just use escape

Changed 7 years ago by daemondazz

Updated patch using escape()

comment:2 Changed 7 years ago by daemondazz

Update to use escape() as suggested.

comment:3 Changed 7 years ago by Chris Beaven

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:4 Changed 7 years ago by daemondazz

Any movement on this ticket? I still need to apply the patch against 1.1

comment:5 Changed 7 years ago by Chris Beaven

Bring up requests like this in the django developers google group.

If you wanted to make this patch better, you could write a test too.

comment:6 Changed 7 years ago by Luke Plant

Resolution: fixed
Status: newclosed

(In [11486]) Fixed #11252: Invalid XHTML when filtering a paginated list.

Thanks daemondazz

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