From: jordan Date: Mon, 18 Apr 2011 16:53:39 +0000 (+0000) Subject: escape the base path when building the pagination URLs X-Git-Tag: live~326 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/24da082f86cbb6dae0d55f66c42e4e2c55ac66d1 escape the base path when building the pagination URLs git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@987 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/utils/pagination.py b/forum/utils/pagination.py index 382e59e..f607cd0 100644 --- a/forum/utils/pagination.py +++ b/forum/utils/pagination.py @@ -240,9 +240,9 @@ def _paginated(request, objects, context): page_numbers = [] if sort: - url_builder = lambda n: mark_safe("%s%s%s=%s&%s=%s" % (base_path, url_joiner, context.SORT, sort, context.PAGE, n)) + url_builder = lambda n: mark_safe("%s%s%s=%s&%s=%s" % (escape(base_path), url_joiner, context.SORT, sort, context.PAGE, n)) else: - url_builder = lambda n: mark_safe("%s%s%s=%s" % (base_path, url_joiner, context.PAGE, n)) + url_builder = lambda n: mark_safe("%s%s%s=%s" % (escape(base_path), url_joiner, context.PAGE, n)) if range_start > (context.outside_page_range + 1): page_numbers.append([(n, url_builder(n)) for n in range(1, context.outside_page_range + 1)])