From be52279bfac6e52528b6755f700b32967da33356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sat, 21 Apr 2007 18:05:32 +0000 Subject: [PATCH] Fix comment creation. addcomment.php was passing a filled-in object to comment::create() which still expected values as parameters. Load data from the object instead --- include/comment.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/comment.php b/include/comment.php index 5d2ad3e..69e06f5 100644 --- a/include/comment.php +++ b/include/comment.php @@ -55,11 +55,14 @@ class Comment { * Informs interested people about the creation. * Returns true on success, false on failure */ - function create($sSubject, $sBody, $iParentId=null, $iVersionId) + function create() { - $hResult = query_parameters("INSERT INTO appComments (parentId, versionId, subject, ". - "body, userId, time, hostname) VALUES ('?', '?', '?', '?', '?', ?, '?')", - $iParentId, $iVersionId, $sSubject, $sBody, + $hResult = query_parameters("INSERT INTO appComments + (parentId, versionId, subject, ". + "body, userId, time, hostname) + VALUES ('?', '?', '?', '?', '?', ?, '?')", + $this->iParentId, $this->iVersionId, + $this->sSubject, $this->sBody, $_SESSION['current']->iUserId, "NOW()", get_remote()); @@ -71,6 +74,7 @@ class Comment { // fetches e-mails from parent comments, all parents are notified that a // comment was added to the thread + $iParentId = $this->iParentId; while($iParentId) { $oParent = new Comment($iParentId);