From cd51842ce86c44eef4e3c3d5334aca13e234151a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 20 Aug 2012 23:50:21 -0500 Subject: Fix scm_link for Unicode characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This blew up with non-ASCII due to us trying to stuff 8-bit characters into the URL parameters where they aren't allowed. Tested with a package entered via the admin with pkgname and pkgbase set to 'αναζήτη'. Signed-off-by: Dan McGee --- packages/templatetags/package_extras.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 9daecd96..a0ee8bee 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -91,11 +91,12 @@ def packager_link(user): @register.simple_tag def scm_link(package, operation): - parts = (package.repo.svn_root, operation, package.pkgbase) - linkbase = ( - "https://projects.archlinux.org/svntogit/%s.git/%s/trunk?" - "h=packages/%s") - return linkbase % tuple(urlquote(part) for part in parts) + parts = (package.repo.svn_root, operation) + url = "https://projects.archlinux.org/svntogit/%s.git/%s/trunk" % parts + data = { + 'h': 'packages/%s' % package.pkgbase + } + return link_encode(url, data) @register.simple_tag def get_wiki_link(package): -- cgit v1.2.3-54-g00ecf