diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index eda234c07..c1f8eed11 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -1422,7 +1422,7 @@ class comment */ - function getCommentData($amount = '', $from = '', $qry = '', $cdvalid = FALSE, $cdreta = FALSE) + function getCommentData($amount = '', $from = 0, $qry = '', $cdvalid = FALSE, $cdreta = FALSE) { if($this->engine != 'e107') diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 51a4a717c..466cc83b9 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -396,13 +396,15 @@ class poll // $voteArray = array_slice($voteArray, 0, -1); } - $voteTotal = array_sum($voteArray); + $voteTotal = intval(array_sum($voteArray)); $percentage = array(); if (count($voteArray)) { foreach ($voteArray as $votes) { + $votes = intval($votes); + if ($voteTotal > 0) { $percentage[] = round(($votes/$voteTotal) * 100, 2);