#8561 closed defect (fixed)
URL hex encoding in Query.to_string()
Reported by: | ebray | Owned by: | ebray |
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | ticket system | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When I save a custom query containing a filter such as "summary=~foo", it's displayed in the save report page as "summary=%7Efoo". I know that this is due to Query.to_string() just being a thin wrapper around Query.get_href(). But I thought that at least this was fixed a long time ago. Is this a regression, or was it never fixed?
I simply modified my to_string to wrap the call to self.get_href() in unicode_unquote(). That solves the problem nicely, and doesn't seem to have any adverse effects.
You'd think there'd be a ticket addressing this somewhere, but I couldn't find one.
Attachments (0)
Change History (10)
comment:1 by , 15 years ago
Milestone: | → 0.12 |
---|---|
Owner: | set to |
comment:2 by , 15 years ago
Yeah, I actually fixed this several months ago in my branch of Trac:
-
trac/trac/ticket/query.py
a b 35 35 from trac.util.datefmt import to_timestamp, utc 36 36 from trac.util.presentation import Paginator 37 from trac.util.text import shorten_line 37 from trac.util.text import shorten_line, unicode_unquote 38 38 from trac.util.translation import _ 39 39 from trac.web import parse_query_string, IRequestHandler … … 376 376 expressed in TracQuery language. 377 377 """ 378 query_string = self.get_href(Href(''))378 query_string = unicode_unquote(self.get_href(Href(''))) 379 379 if query_string and '?' in query_string: 380 380 query_string = query_string.split('?', 1)[1]
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
No side-effects here either, so I guess it's ok. Patch committed in [8465]. Strangely, except for the cosmetic factor, it was also working correctly before. Does this mean that the following URLs are actually equivalent?
http://example.com/trac?summary=~foo http://example.com/trac?summary=%7Efoo
Too tired to read RFCs…
comment:4 by , 15 years ago
Owner: | changed from | to
---|
comment:5 by , 15 years ago
There is another query.get_href at line 822 and it breaks *some* queries in *some* browsers. Changing
req.redirect(query.get_href(req.href))
to
req.redirect(unicode_unquote(query.get_href(req.href)))
seems to fix it.
comment:7 by , 14 years ago
This change caused #9965, so I will revert it, while still trying to keep the query readable.
comment:8 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Help… I've 1.0.1 version as different projects. When I put latin letters into summary field all is o'k, but if I put russian letters there - it recodes into percentage format and searches nothing. If put russian letters into URL string - search works o'k. What I do wrong?
comment:9 by , 11 years ago
I wonder if rather than reopening a 5 year old ticket it wouldn't be better to create a new one if this is truly a regression. I wonder if it's a browser-specific bug. I couldn't reproduce this on the latest Firefox.
comment:10 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Indeed. Please open a new bug with a precise description of how to reproduce the issue and the symptoms you observe.
I'll check that. Thanks for reporting the issue.