From e2b6a034c6d00684d5db5657596b5fc585c8cd13 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 11 Feb 2008 20:05:05 +0000 Subject: [PATCH] r1606: Merging the changes from r1605 from trunk to branch. Fixes bug://report/120 --- docs/changes.txt | 1 + editcomment.php | 10 +++++++++- includes/api_comment.php | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index d1842d5..69a2f7e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -7,6 +7,7 @@ - Fixed: If a user has set a language that does not exist anymore, then bug notifications would fail (bug://report/97) - Fixed: Users of UTF8 languages would experience problems after upgrading (if the $utf8 config directive as ON) because the installer wasn't running in UTF8 - Fixed: In Authentication::_createBugdarUser there was a variable capitalization error (bug://report/106) +- Fixed: Comments posted by guests could not be deleted (bug://report/120) 1.2.1 =============================== diff --git a/editcomment.php b/editcomment.php index 1ec7c4e..a9ca64d 100644 --- a/editcomment.php +++ b/editcomment.php @@ -189,7 +189,15 @@ if ($_REQUEST['do'] == 'edit') } $comment['posttime'] = $datef->format($bugsys->options['dateformat'], $comment['dateline']); - $comment['postby'] = construct_user_display($commentapi->relations['userid']->objdata); + if ($comment['userid']) + { + $commenter = new UserAPI($bugsys); + $commenter->set('userid', $comment['userid']); + $commenter->set_condition(); + $commenter->fetch(); + $commenter = $commenter->objdata; + } + $comment['postby'] = construct_user_display($commenter); $comment['comment'] = $bugsys->sanitize($comment['comment']); $show['hide'] = ($bug['initialreport'] != $comment['commentid'] ? true : false); eval('$template->flush("' . $template->fetch('editcomment') . '");'); diff --git a/includes/api_comment.php b/includes/api_comment.php index 7a51a2a..b33f2f7 100644 --- a/includes/api_comment.php +++ b/includes/api_comment.php @@ -40,7 +40,7 @@ class CommentAPI extends API var $fields = array( 'commentid' => array(TYPE_UINT, REQ_AUTO, 'verify_nozero'), 'bugid' => array(TYPE_UINT, REQ_YES, 'verify_nozero'), - 'userid' => array(TYPE_UINT, REQ_NO, null, array('includes/api_user.php', 'UserAPI')), + 'userid' => array(TYPE_UINT, REQ_NO), 'dateline' => array(TYPE_UINT, REQ_SET), 'parselinks' => array(TYPE_BOOL, REQ_NO), 'comment' => array(TYPE_STR, REQ_YES, 'verify_noempty'), -- 2.43.5