flip escape order
We were double escaping commas and dashes because we escaped them first, then escaped the % with urlencode. If we do this in the other order we get shorter and less fragile urls. Change-Id: I0f5f2d486c66a62469eae02d884fb31de78df803
This commit is contained in:
@@ -46,8 +46,8 @@ def generate_dashboard_url(dashboard):
|
|||||||
baseurl = 'https://review.openstack.org/#/dashboard/?'
|
baseurl = 'https://review.openstack.org/#/dashboard/?'
|
||||||
|
|
||||||
url = baseurl
|
url = baseurl
|
||||||
url += urllib.urlencode({'title': escape(title),
|
url += escape(urllib.urlencode({'title': title,
|
||||||
'foreach': escape(foreach)})
|
'foreach': foreach}))
|
||||||
for section in dashboard.sections():
|
for section in dashboard.sections():
|
||||||
if not section.startswith('section'):
|
if not section.startswith('section'):
|
||||||
continue
|
continue
|
||||||
@@ -58,7 +58,7 @@ def generate_dashboard_url(dashboard):
|
|||||||
raise ValueError("option 'query' in '%s' not set" % section)
|
raise ValueError("option 'query' in '%s' not set" % section)
|
||||||
|
|
||||||
title = section[9:-1]
|
title = section[9:-1]
|
||||||
encoded = urllib.urlencode({escape(title): escape(query)})
|
encoded = escape(urllib.urlencode({title: query}))
|
||||||
url += "&%s" % encoded
|
url += "&%s" % encoded
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user