From 6222c0d093464a7e2b314fcb5adcc43005a217fb Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 22 Feb 2012 13:25:03 +0000 Subject: [PATCH] redirect to the bottom of the thread when commenting --- ext/comment/main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index b67068eb..e7180efa 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -117,10 +117,11 @@ class CommentList extends Extension { if($event->get_arg(0) === "add") { if(isset($_POST['image_id']) && isset($_POST['comment'])) { try { + $i_iid = int_escape($_POST['image_id']); $cpe = new CommentPostingEvent($_POST['image_id'], $user, $_POST['comment']); send_event($cpe); $page->set_mode("redirect"); - $page->set_redirect(make_link("post/view/".int_escape($_POST['image_id']))); + $page->set_redirect(make_link("post/view/$i_iid#comment_on_$i_iid")); } catch(CommentPostingException $ex) { $this->theme->display_error(403, "Comment Blocked", $ex->getMessage());