Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objectfs mimetype null/string handling #663

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 !empty($mimetype) ? $mimetype : '';
}

/**
Expand Down
Loading