From: tjhunt Date: Tue, 28 Nov 2006 18:44:18 +0000 (+0000) Subject: MDL-7720 - non-unicode-safe case-insensitive string comparison in shortanswer questio... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=485349ddf29758d10d517af4dc0403c40c887399;p=moodle.git MDL-7720 - non-unicode-safe case-insensitive string comparison in shortanswer question type. Merged from MOODLE_17_STABLE. --- diff --git a/question/type/shortanswer/questiontype.php b/question/type/shortanswer/questiontype.php index 94bdd4b30e..1d03a54806 100644 --- a/question/type/shortanswer/questiontype.php +++ b/question/type/shortanswer/questiontype.php @@ -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;