MDL-69078 questions: check for UTF-8 encoding of the import file

Signed-off-by: Daniel Ziegenberg <[email protected]>
This commit is contained in:
Daniel Ziegenberg
2022-03-17 20:53:50 +01:00
parent 01eb6d2e9b
commit f942a5cedd
10 changed files with 118 additions and 0 deletions
+12
View File
@@ -58,6 +58,18 @@ class qformat_xml extends qformat_default {
return 'application/xml';
}
/**
* 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);
}
// IMPORT FUNCTIONS START HERE.
/**