summaryrefslogtreecommitdiff
path: root/django/contrib/comments/views/comments.py
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2012-11-17 22:00:53 +0100
committerFlorian Apolloner <florian@apolloner.eu>2012-12-10 22:14:16 +0100
commitb2ae0a63aeec741f1e51bac9a95a27fd635f9652 (patch)
tree7635165e2aafa25d89d74b27e33bcd2bcf6e0910 /django/contrib/comments/views/comments.py
parent8c9a8fd5c4e5ed157d2d5fa09f3d6d05d2290bbf (diff)
[1.4.X] Fixed #18856 -- Ensured that redirects can't be poisoned by malicious users.
Diffstat (limited to 'django/contrib/comments/views/comments.py')
-rw-r--r--django/contrib/comments/views/comments.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/django/contrib/comments/views/comments.py b/django/contrib/comments/views/comments.py
index 57720163c3..20c172f0d2 100644
--- a/django/contrib/comments/views/comments.py
+++ b/django/contrib/comments/views/comments.py
@@ -44,9 +44,6 @@ def post_comment(request, next=None, using=None):
if not data.get('email', ''):
data["email"] = request.user.email
- # Check to see if the POST data overrides the view's next argument.
- next = data.get("next", next)
-
# Look up the object we're trying to comment about
ctype = data.get("content_type")
object_pk = data.get("object_pk")
@@ -98,9 +95,9 @@ def post_comment(request, next=None, using=None):
]
return render_to_response(
template_list, {
- "comment" : form.data.get("comment", ""),
- "form" : form,
- "next": next,
+ "comment": form.data.get("comment", ""),
+ "form": form,
+ "next": data.get("next", next),
},
RequestContext(request, {})
)
@@ -131,7 +128,7 @@ def post_comment(request, next=None, using=None):
request = request
)
- return next_redirect(data, next, comment_done, c=comment._get_pk_val())
+ return next_redirect(request, next, comment_done, c=comment._get_pk_val())
comment_done = confirmation_view(
template = "comments/posted.html",