From d8497bf4863991e470b35446347e55756d923cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 23 Apr 2010 12:13:53 +0200 Subject: Fixed detected feed URL for relative URIs Bug #609817 --- embed/ephy-web-view.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 70444bc17..f5d155863 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1264,8 +1264,21 @@ do_hook_into_links (JSContextRef js_context, EphyWebView *web_view) char *type = js_get_element_attribute (js_context, obj, "type"); char *title = js_get_element_attribute (js_context, obj, "title"); char *address = js_get_element_attribute (js_context, obj, "href"); + SoupURI *feed_uri, *current_uri; - g_signal_emit_by_name (web_view, "ge-feed-link", type, title, address); + feed_uri = soup_uri_new (address); + if (!feed_uri) { + current_uri = soup_uri_new (ephy_web_view_get_address (web_view)); + feed_uri = soup_uri_new_with_base (current_uri, address); + soup_uri_free (current_uri); + } + + if (feed_uri) { + g_free (address); + address = soup_uri_to_string (feed_uri, FALSE); + g_signal_emit_by_name (web_view, "ge-feed-link", type, title, address); + soup_uri_free (feed_uri); + } g_free (type); g_free (title); -- cgit v1.2.3