[evolution-rss] inline images do not go out when sending emails in evolution



commit 4049f4fb97514850bec1618c42973ba1aa728f14
Author: Lucian Langa <lucilanga gnome org>
Date:   Sat Oct 31 22:04:43 2009 +0200

    inline images do not go out when sending emails in evolution

 src/parser.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/parser.c b/src/parser.c
index ec0cc37..b755118 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -48,6 +48,8 @@ rss_html_url_decode(const char *html, int len)
 	xmlDoc *src = NULL;
 	xmlDoc *doc = NULL;
 	gchar *url, *tmpurl;
+	gchar *base_dir = rss_component_peek_base_directory();
+	gchar *feed_dir;
 
 	src = (xmlDoc *)parse_html_sux(html, len);
 
@@ -56,13 +58,25 @@ rss_html_url_decode(const char *html, int len)
 
 	doc = src;
 
+	feed_dir = g_build_path("/",
+		base_dir,
+		"static",
+		"http",
+		NULL);
+	g_free(base_dir);
+
 	while ((doc = (xmlDoc *)html_find((xmlNode *)doc, (gchar *)"img"))) {
 		if ((url = (gchar *)xmlGetProp((xmlNodePtr)doc, (xmlChar *)"src"))) {
+			if (strstr(url, feed_dir) == NULL) {
+				g_free(feed_dir);
+				return NULL;
+			}
 			tmpurl = camel_url_decode_path(strstr(url, "http:"));
 			xmlSetProp((xmlNodePtr)doc, (xmlChar *)"src", (xmlChar *)tmpurl);
 			g_free(tmpurl);
 		}
 	}
+	g_free(feed_dir);
 	return src;
 }
 



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