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.
Attachments (1)
Change History (3)
by , 13 years ago
Attachment: | quote-query-string.diff added |
---|
comment:1 by , 13 years ago
Owner: | set to |
---|
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 212 212 213 213 query:verbose=1 214 214 215 query: type=résumé215 query:summary=résumé 216 216 ------------------------------ 217 217 <p> 218 218 <a class="query" href="/query?order=priority">query:?order=priority</a> … … query:type=résumé 239 239 <a class="query" href="/query?order=priority&row=description">query:verbose=1</a> 240 240 </p> 241 241 <p> 242 <a class="query" href="/query? type=r%C3%A9sum%C3%A9&order=priority">query:type=résumé</a>242 <a class="query" href="/query?summary=r%C3%A9sum%C3%A9&order=priority">query:summary=résumé</a> 243 243 </p> 244 244 ------------------------------ 245 245 ============================== TicketQuery macro: no results, list form
Please apply.
comment:2 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for the review, Remy! The two patches have been committed in [10842].
patch based on 0.12-stable@10757