Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

#10275 closed defect (fixed)

`query:?`, saved custom query and `search:` links should quote the query string

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.3
Component: report system Version: 0.12.2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

query:?, saved custom query and search: links can be contained raw query string. Trac generates a anchor and sends Location header using the query string.

When the query string has non-ascii characters, Trac uses it without quoting.

query:?type=résumé which is saved in report sends Location: http://example.org/query?type=résumé, expects Location: http://example.org/query?type=r%C3%A9sum%C3%A9.

IE on Windows processes Location header using ANSI codepage. As a result, UnicodeDecodeError often happens.

quote-query-string.diff.

Attachments (1)

quote-query-string.diff (8.7 KB ) - added by Jun Omae 13 years ago.
patch based on 0.12-stable@10757

Download all attachments as: .zip

Change History (3)

by Jun Omae, 13 years ago

Attachment: quote-query-string.diff added

patch based on 0.12-stable@10757

comment:1 by Remy Blank, 13 years ago

Owner: set to Jun Omae

I'm unable to reproduce the issue with IE9, but the patch makes sense and looks good. I see one failure in the unit tests, due to a recent change where we filter out unused fields in ticket queries. The following patch fixes the issue:

  • trac/ticket/tests/wikisyntax.py

    diff --git a/trac/ticket/tests/wikisyntax.py b/trac/ticket/tests/wikisyntax.py
    a b query:group=owner  
    212212
    213213query:verbose=1
    214214
    215 query:type=résumé
     215query:summary=résumé
    216216------------------------------
    217217<p>
    218218<a class="query" href="/query?order=priority">query:?order=priority</a>
    query:type=résumé  
    239239<a class="query" href="/query?order=priority&amp;row=description">query:verbose=1</a>
    240240</p>
    241241<p>
    242 <a class="query" href="/query?type=r%C3%A9sum%C3%A9&amp;order=priority">query:type=résumé</a>                                                                 
     242<a class="query" href="/query?summary=r%C3%A9sum%C3%A9&amp;order=priority">query:summary=résumé</a>                                                           
    243243</p>
    244244------------------------------
    245245============================== TicketQuery macro: no results, list form

Please apply.

comment:2 by Jun Omae, 13 years ago

Resolution: fixed
Status: newclosed

Thanks for the review, Remy! The two patches have been committed in [10842].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.