Skip to content
Snippets Groups Projects

mmsd: trust MMS MIME type if it is text/plain

Merged Chris Talbot requested to merge kop316/chatty:wip/mime into master
All threads resolved!
+ 3
0
@@ -1061,6 +1061,9 @@ chatty_mmsd_receive_message (ChattyMmsd *self,
if (error != NULL) {
g_clear_error (&error);
attachment->mime_type = g_strdup (mimetype);
+3
} else if (g_str_match_string ("text/plain", attachment->mime_type, TRUE)) {
/* If the MMS reports the attachment is text/plain, trust it */
attachment->mime_type = g_strdup (mimetype);
} else if (g_file_info_get_content_type (attachment_info) == NULL) {
/* If we can't figure out content type, do not trust what the MMS tells it is */
attachment->mime_type = g_strdup ("application/octet-stream");
Loading