From 767e147dacf30f64298463134ffa79edfcd93b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Wed, 6 Sep 2023 23:21:14 +0200 Subject: [PATCH] MDL-79226 questions: check for UTF-8 encoding of the import file --- question/format/aiken/format.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/question/format/aiken/format.php b/question/format/aiken/format.php index ab76310b157..01bd6f16b15 100644 --- a/question/format/aiken/format.php +++ b/question/format/aiken/format.php @@ -61,6 +61,18 @@ class qformat_aiken extends qformat_default { return true; } + /** + * Validate the given file. + * + * For more expensive or detailed integrity checks. + * + * @param stored_file $file the file to check + * @return string the error message that occurred while validating the given file + */ + public function validate_file(stored_file $file): string { + return $this->validate_is_utf8_file($file); + } + public function readquestions($lines) { $questions = array(); $question = null;