from models import Question
from forum import settings
from forum.modules import decorate
from models import Question
from forum import settings
from forum.modules import decorate
+from forum.utils.pagination import generate_uri
@decorate(add_domain, needs_origin=False)
def add_domain(domain, url):
@decorate(add_domain, needs_origin=False)
def add_domain(domain, url):
class RssQuestionFeed(BaseNodeFeed):
def __init__(self, request, question_list, title, description):
class RssQuestionFeed(BaseNodeFeed):
def __init__(self, request, question_list, title, description):
- url = request.path + "&" + "&".join(["%s=%s" % (k, v) for k, v in request.GET.items() if not k in (_('page'), _('pagesize'), _('sort'))])
+ url = request.path + "&" + generate_uri(request.GET, (_('page'), _('pagesize'), _('sort')))
super(RssQuestionFeed, self).__init__(request, title, description, url)
self._question_list = question_list
super(RssQuestionFeed, self).__init__(request, title, description, url)
self._question_list = question_list
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from django.utils.html import strip_tags
from django.utils.http import urlquote
from django.utils.safestring import mark_safe
from django.utils.html import strip_tags
+from forum.utils.html import sanitize_html
import logging
def generate_uri(querydict, exclude=None):
import logging
def generate_uri(querydict, exclude=None):
for k, l in querydict.iterlists():
if (not exclude) or (not k in exclude):
for k, l in querydict.iterlists():
if (not exclude) or (not k in exclude):
- all += ["%s=%s" % (k, urlquote(v)) for v in l]
+ all += ["%s=%s" % (k, urlquote(strip_tags(v))) for v in l]
from forum.actions import QuestionViewAction
from forum.http_responses import HttpResponseUnauthorized
from forum.feed import RssQuestionFeed, RssAnswerFeed
from forum.actions import QuestionViewAction
from forum.http_responses import HttpResponseUnauthorized
from forum.feed import RssQuestionFeed, RssAnswerFeed
+from forum.utils.pagination import generate_uri
import decorators
class HottestQuestionsSort(pagination.SortBase):
import decorators
class HottestQuestionsSort(pagination.SortBase):
#answer_description = _("answers")
if not feed_url:
#answer_description = _("answers")
if not feed_url:
- req_params = "&".join(["%s=%s" % (k, v) for k, v in request.GET.items() if not k in (_('page'), _('pagesize'), _('sort'))])
+ req_params = "&".join(generate_uri(request.GET, (_('page'), _('pagesize'), _('sort'))))
if req_params:
req_params = '&' + req_params
if req_params:
req_params = '&' + req_params