Remove double escape_string on test edit - ref 6558

1.9.x
Hubert Borderiou 13 years ago
parent 86e02568d8
commit 9799814ecf
  1. 5
      main/exercice/answer.class.php

@ -467,7 +467,6 @@ class Answer {
$TBL_REPONSES = Database :: get_course_table(TABLE_QUIZ_ANSWER); $TBL_REPONSES = Database :: get_course_table(TABLE_QUIZ_ANSWER);
$table_track_e_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); $table_track_e_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$questionId = intval($this->questionId); $questionId = intval($this->questionId);
$c_id = $this->course['real_id']; $c_id = $this->course['real_id'];
// inserts new answers into data base // inserts new answers into data base
@ -487,7 +486,9 @@ class Answer {
$flag = 1; $flag = 1;
$sql.="($c_id, '$i','$questionId','$answer','$correct','$comment','$weighting','$position','$hotspot_coordinates','$hotspot_type','$destination'),"; $sql.="($c_id, '$i','$questionId','$answer','$correct','$comment','$weighting','$position','$hotspot_coordinates','$hotspot_type','$destination'),";
} else { } else {
$this->updateAnswers($answer, $comment, $correct, $weighting, $position, $destination); // https://support.chamilo.org/issues/6558
// function updateAnswers already escape_string, error if we do it twice. Feed function updateAnswers with none escaped strings
$this->updateAnswers($this->new_answer[$i], $this->new_comment[$i], $this->new_correct[$i], $this->new_weighting[$i], $this->new_position[$i], $this->new_destination[$i]);
} }
} }
if ($flag == 1) { if ($flag == 1) {

Loading…
Cancel
Save