If you try to delete a comment just after posting it without leaving the page, 
AUR can't find $row['ID¡] as it get emptied.

Regards.
From 5134219fb13c3e2432524d0db831c8f46f55b505 Mon Sep 17 00:00:00 2001
From: Manuel Tortosa <manutort...@gmail.com>
Date: Wed, 29 Sep 2010 12:48:52 +0200
Subject: [PATCH] Fix comment deletion issue

---
 web/template/pkg_comments.php |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index 02171a0..4f7560a 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -5,7 +5,11 @@ while (list($indx, $carr) = each($comments)) { ?>
 	<div class="comment-header"><?php
 	if (canDeleteCommentArray($carr, $atype, $uid)) {
 		$durl = '<a href="pkgedit.php?del_Comment=1';
-		$durl.= '&comment_id=' . $carr['ID'] . '&ID=' . $row['ID'];
+		if (intval($row['ID'])==0) {
+			$durl.= '&comment_id=' . $carr['ID'] . '&ID=' . $_GET['ID'];
+		} else {
+			$durl.= '&comment_id=' . $carr['ID'] . '&ID=' . $row['ID'];
+		}
 		$durl.= '"><img src="images/x.png" border="0"';
 		$durl.= ' alt="' . __("Delete comment") . '"></a> ';
 
-- 
1.7.1

Reply via email to