[balsa] html: fix some 'cid:' issues



commit c399ee706f59dc0eb308b824534dbee2a8c70a29
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Fri Feb 22 09:43:10 2019 -0500

    html: fix some 'cid:' issues
    
    * libbalsa/html.c (lbh_web_view_new): use a static location when
      registering 'cid:' scheme; fix the regular expression for
      matching non-cid schemes (it was also matching 'cid:')

 ChangeLog       | 6 ++++++
 libbalsa/html.c | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 49d0488f2..2385c884c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-02-22  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * libbalsa/html.c (lbh_web_view_new): use a static location when
+       registering 'cid:' scheme; fix the regular expression for
+       matching non-cid schemes (it was also matching 'cid:')
+
 2019-02-19  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * libbalsa/mailbox_imap.c (lbm_imap_get_msg_part_from_cache):
diff --git a/libbalsa/html.c b/libbalsa/html.c
index ea50bc453..f83c6155f 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -44,7 +44,7 @@
 
 
 #define CID_REGEX      "<[^>]*src\\s*=\\s*['\"]?\\s*cid:"
-#define SRC_REGEX      "<[^>]*src\\s*=\\s*['\"]?\\s*[^c][^i][^d][^:]"
+#define SRC_REGEX      "<[^>]*src\\s*=\\s*['\"]?\\s*[^c'\"][^i][^d][^:]"
 
 /* approximate image resolution for printing */
 #define HTML_PRINT_DPI                 200.0
@@ -597,7 +597,9 @@ lbh_web_view_new(LibBalsaWebKitInfo *info,
        WebKitWebView *view;
        WebKitSettings *settings;
        static guint have_registered_cid = 0U;
+        static LibBalsaWebKitInfo *info_for_cid;
 
+        info_for_cid = info;
        view = WEBKIT_WEB_VIEW(webkit_web_view_new());
     g_object_set_data_full(G_OBJECT(view), LIBBALSA_HTML_INFO, info, (GDestroyNotify) lbh_webkit_info_free);
     gtk_widget_set_size_request(GTK_WIDGET(view), width, height);
@@ -618,7 +620,7 @@ lbh_web_view_new(LibBalsaWebKitInfo *info,
          * LibBalsaWebKitInfo. */
 
         context = webkit_web_view_get_context(view);
-        webkit_web_context_register_uri_scheme(context, "cid", lbh_cid_cb, &info, NULL);
+        webkit_web_context_register_uri_scheme(context, "cid", lbh_cid_cb, &info_for_cid, NULL);
         g_debug("%s_ registered “cid:” scheme", __func__);
        }
 


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