diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 2885575be23..bc63b319efd 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -156,14 +156,16 @@ if (empty($reshook)) { } // Delete comment - $idcomment = GETPOST('deletecomment', 'int'); - if ($idcomment) { - // Security check - if (!$user->rights->opensurvey->write) { - accessforbidden(); - } + if ($action == 'deletecomment') { + $idcomment = GETPOST('idcomment', 'int'); + if ($idcomment > 0) { + // Security check + if (!$user->rights->opensurvey->write) { + accessforbidden(); + } - $resql = $object->deleteComment($idcomment); + $resql = $object->deleteComment($idcomment); + } } if ($action == 'edit') { @@ -356,7 +358,7 @@ print '