From cefbe813946f9f9e0108193156eedfd265befc33 Mon Sep 17 00:00:00 2001 From: hernani Date: Mon, 25 Apr 2011 00:20:02 +0000 Subject: [PATCH] Fixes small bug with rss feed url generation. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1001 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/utils/pagination.py | 3 ++- forum/views/readers.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/forum/utils/pagination.py b/forum/utils/pagination.py index f607cd0..2b71dbd 100644 --- a/forum/utils/pagination.py +++ b/forum/utils/pagination.py @@ -3,6 +3,7 @@ from django.utils.datastructures import SortedDict from django import template from django.core.paginator import Paginator, EmptyPage from django.utils.translation import ugettext as _ +from django.utils.html import escape from django.http import Http404 from django.utils.http import urlquote from django.utils.safestring import mark_safe @@ -15,7 +16,7 @@ def generate_uri(querydict, exclude=None): for k, l in querydict.iterlists(): if (not exclude) or (not k in exclude): - all += ["%s=%s" % (k, urlquote(strip_tags(v))) for v in l] + all += ["%s=%s" % (k, escape(strip_tags(v))) for v in l] return "&".join(all) diff --git a/forum/views/readers.py b/forum/views/readers.py index e800487..5989dcd 100644 --- a/forum/views/readers.py +++ b/forum/views/readers.py @@ -181,11 +181,11 @@ def question_list(request, initial, #answer_description = _("answers") if not feed_url: - req_params = "&".join(generate_uri(request.GET, (_('page'), _('pagesize'), _('sort')))) + req_params = generate_uri(request.GET, (_('page'), _('pagesize'), _('sort'))) if req_params: req_params = '&' + req_params - feed_url = mark_safe(escape(request.path + "?type=rss" + req_params)) + feed_url = request.path + "?type=rss" + req_params return pagination.paginated(request, ('questions', paginator_context or QuestionListPaginatorContext()), { "questions" : questions.distinct(), -- 2.39.5