MDL-7720 - non-unicode-safe case-insensitive string comparison in shortanswer question type. Merged from MOODLE_17_STABLE.
This commit is contained in:
@@ -190,7 +190,9 @@ class question_shortanswer_qtype extends default_questiontype {
|
||||
if ($question->options->usecase) {
|
||||
return strcmp($state->responses[''], $teststate->responses['']) == 0;
|
||||
} else {
|
||||
return strcasecmp($state->responses[''], $teststate->responses['']) == 0;
|
||||
$textlib = textlib_get_instance();
|
||||
return strcmp($textlib->strtolower($state->responses['']),
|
||||
$textlib->strtolower($teststate->responses[''])) == 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user