From d108dd13c9eb724ce0ece8aa9f814ef7ea1b528d Mon Sep 17 00:00:00 2001 From: Vithusha Kethiri Date: Tue, 21 Jan 2025 11:32:03 +1100 Subject: [PATCH] fix: update string handling in mimetype in objectfs manipulator --- classes/local/store/object_file_system.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/local/store/object_file_system.php b/classes/local/store/object_file_system.php index 86942af6..696af9cf 100644 --- a/classes/local/store/object_file_system.php +++ b/classes/local/store/object_file_system.php @@ -178,11 +178,13 @@ protected function get_mimetype_from_hash(string $contenthash): string { // We limit 1 because multiple files can have the same contenthash. // However, they all have the same mimetype so it does not matter which one we query. - return $DB->get_field_sql('SELECT mimetype + $mimetype = $DB->get_field_sql('SELECT mimetype FROM {files} WHERE contenthash = :hash LIMIT 1', ['hash' => $contenthash]); + + return $mimetype ?? ''; } /**