Skip to content

Commit

Permalink
Fixed issue #7105: Bad error handling on invalid lastgroup POST
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Dec 22, 2012
1 parent 87cacbf commit 0df3fdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/libraries/Save.php
Expand Up @@ -281,7 +281,7 @@ function set_answer_time()
$setField = $_POST['lastanswer'];
}
elseif (isset($_POST['lastgroup']))
{
{
$setField = $_POST['lastgroup'];
}
$passedTime = round(microtime(true) - $_POST['start_time'],2);
Expand All @@ -293,7 +293,9 @@ function set_answer_time()
}
else
{
$aColumnNames=Survey_timings::model($thissurvey['sid'])->getTableSchema()->columnNames;
$setField .= "time";
if (!in_array($setField,$aColumnNames)) die('Invalid last group timing fieldname');
$setField = Yii::app()->db->quoteColumnName($setField);
$query = "UPDATE {{survey_{$thissurvey['sid']}_timings}} SET "
."interviewtime = (CASE WHEN interviewtime IS NULL THEN 0 ELSE interviewtime END) + " .$passedTime .","
Expand Down

0 comments on commit 0df3fdf

Please sign in to comment.