Message5867
It looks like this issue was handled by switching to using:
<a href="#"
tal:attributes="href python:request.indexargs_url('issue', {
'@sort': '-activity',
'@group': 'priority',
'@filter': 'status,assignedto',
'@columns': columns,
'@search_text': '',
'status': status_notresolved,
'assignedto': '-1',
'@dispname': i18n.gettext('Show Unassigned'),
})"
for the default queries. So it looks like indexargs_url is doing the
required %20 url encoding etc. If I use:
utils.url_quote(i18n.gettext('Show Unassigned'))
@displname is Show%2520Unassigned and is displayed as Show%20Unassigned
as the page title. So it gets double encoded.
Also there is a utils.url_quote function in roundup/cgi/templating.py
so no need to add one to the extensions directory.
However the "Your queries" has the original issue. Spaces in the
query names sent as @dispname are not escaped. I added a url_quote function:
def url_quote(self):
""" Return the string in plain format but escaped for use in a
url """
return urllib.quote(self.plain())
to templating.py:StringHTMLProperty and changed the query display code to:
<tal:block tal:repeat="qs request/user/queries">
- <a href="#" tal:attributes="href
string:${qs/klass}?${qs/url}&@dispname=${qs/name}"
+ <a href="#" tal:attributes="href
string:${qs/klass}?${qs/url}&@dispname=${qs/name/url_quote}"
tal:content="qs/name">link</a><br>
(change qs/name to qs/name/url_quote for the @dispname parameter only).
Patch attached changing all the default templates. It doesn't
look like the jinja2 template displays the queries so it doesn't have
this issue.
Thoughts?
-- rouilj |
|
Date |
User |
Action |
Args |
2016-07-18 01:41:04 | rouilj | set | messageid: <1468806064.66.0.308524570371.issue2550795@psf.upfronthosting.co.za> |
2016-07-18 01:41:04 | rouilj | set | recipients:
+ rouilj, schlatterbeck, pcaulagi |
2016-07-18 01:41:04 | rouilj | link | issue2550795 messages |
2016-07-18 01:41:02 | rouilj | create | |
|