Roundup Tracker - Issues

Message5867

Author rouilj
Recipients pcaulagi, rouilj, schlatterbeck
Date 2016-07-18.01:41:02
Message-id <1468806064.66.0.308524570371.issue2550795@psf.upfronthosting.co.za>
In-reply-to
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
History
Date User Action Args
2016-07-18 01:41:04rouiljsetmessageid: <1468806064.66.0.308524570371.issue2550795@psf.upfronthosting.co.za>
2016-07-18 01:41:04rouiljsetrecipients: + rouilj, schlatterbeck, pcaulagi
2016-07-18 01:41:04rouiljlinkissue2550795 messages
2016-07-18 01:41:02rouiljcreate