Skip to content

Commit

Permalink
fix: update string handling in mimetype in objectfs manipulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Vithusha Kethiri committed Jan 24, 2025
1 parent 074f934 commit 44b1142
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion classes/local/store/object_file_system.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,12 @@ 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 ?? '';
}

/**
Expand Down

0 comments on commit 44b1142

Please sign in to comment.