From 5dbe762be080ffe9d049734bfe27446c7fc24a99 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 19 Jun 2013 23:52:14 -0700 Subject: [PATCH] Fixes #378 - missing username after comment post. --- comment.php | 3 ++- e107_handlers/comment_class.php | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/comment.php b/comment.php index 473ea577f..401fea973 100644 --- a/comment.php +++ b/comment.php @@ -107,7 +107,7 @@ if(e_AJAX_REQUEST) // TODO improve security { $pid = intval(varset($_POST['pid'], 0)); // ID of the specific comment being edited (nested comments - replies) $row = array(); - $clean_authorname = $_POST['author_name']; + $clean_authorname = vartrue($_POST['author_name'],USERNAME); $clean_comment = $_POST['comment']; $clean_subject = $_POST['subject']; @@ -122,6 +122,7 @@ if(e_AJAX_REQUEST) // TODO improve security $row['user_id'] = (USERID) ? USERID : 0; $row['user_name'] = USERNAME; $row['comment_author_name'] = $tp->toDB($clean_authorname); + $row['comment_author_id'] = (USERID) ? USERID : 0; $row['comment_datestamp'] = time(); $row['comment_blocked'] = (check_class($pref['comments_moderate']) ? 2 : 0); $row['comment_share'] = ($_POST['comment_share']); diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 72b8bfde1..e09a37453 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -292,9 +292,10 @@ class comment $text .= " - \n - \n - \n + + + + \n";