From 11235484bbf436d6bdd736acc0f3e17be257be0d Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Thu, 22 Oct 2009 15:11:50 -0500 Subject: [PATCH] Fixed Bug when make comparative check DT#5496 --- main/survey/survey.lib.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 99144fb348..d9051e8969 100644 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -4017,15 +4017,17 @@ class SurveyUtil { } $counter = 0; - foreach ($answers_x as $user => $answers) - { - // check if the user has given $option_x as answer - if (in_array($check_x, $answers)) + if(is_array($answers_x)){ + foreach ($answers_x as $user => $answers) { - // check if the user has given $option_y as an answer - if (in_array($check_y, $answers_y[$user])) + // check if the user has given $option_x as answer + if (in_array($check_x, $answers)) { - $counter++; + // check if the user has given $option_y as an answer + if (in_array($check_y, $answers_y[$user])) + { + $counter++; + } } } }