[gnumeric] Clipboard: check mime type before pasting image.



commit bf696aa3575af00e0754d97eb7d42754cb76636d
Author: Morten Welinder <terra gnome org>
Date:   Sat Apr 21 18:52:54 2018 -0400

    Clipboard: check mime type before pasting image.

 src/gui-clipboard.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 5a36fc5..c3b14c4 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -527,9 +527,17 @@ urilist_content_received (GtkClipboard *clipboard, GtkSelectionData *sel,
                        GsfInput *input;
                        gsf_off_t size;
                        gconstpointer data;
+                       char *mime;
+                       gboolean qimage;
 
                        if (g_str_equal (uri, "copy"))
                                continue;
+                       mime = go_get_mime_type (uri);
+                       qimage = (strncmp (mime, "image/", 6) == 0);
+                       g_free (mime);
+                       if (!qimage)
+                               continue;
+
                        input = go_file_open (uri, NULL);
                        if (!input)
                                continue;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]