Skip to content

Commit

Permalink
[#54] Use proper escape-method for URL components
Browse files Browse the repository at this point in the history
  • Loading branch information
torfsen committed Sep 28, 2017
1 parent 83a8277 commit 2b0430f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckanext/pages/plugin.py
@@ -1,5 +1,6 @@
import cgi
import logging
import urllib
from pylons import config
import ckan.plugins.toolkit as toolkit
ignore_missing = toolkit.get_validator('ignore_missing')
Expand Down Expand Up @@ -49,7 +50,7 @@ def build_pages_nav_main(*args):

for page in pages_list:
type_ = 'blog' if page['page_type'] == 'blog' else 'pages'
name = cgi.escape(page['name'], quote=True)
name = urllib.quote(page['name'].encode('utf-8')).decode('utf-8')
title = cgi.escape(page['title'])
link = h.literal(u'<a href="/{}/{}">{}</a>'.format(type_, name, title))
if page['name'] == page_name:
Expand Down

0 comments on commit 2b0430f

Please sign in to comment.